WordPress at a glance
function is not described

ParagonIE_Sodium_Compat::randombytes_buf() public WP 1.0

Generate a string of bytes from the kernel's CSPRNG. Proudly uses /dev/urandom (if getrandom(2) is not available).

{} It's a method of the class: ParagonIE_Sodium_Compat{}

No Hooks.

Return

String. Null. Nothing.

Usage

$result = ParagonIE_Sodium_Compat::randombytes_buf( $numBytes );
$numBytes(int) (required)
-

Code of ParagonIE_Sodium_Compat::randombytes_buf() WP 5.7

<?php
public static function randombytes_buf($numBytes)
{
    /* Type checks: */
    if (!is_int($numBytes)) {
        if (is_numeric($numBytes)) {
            $numBytes = (int) $numBytes;
        } else {
            throw new TypeError(
                'Argument 1 must be an integer, ' . gettype($numBytes) . ' given.'
            );
        }
    }
    if (self::use_fallback('randombytes_buf')) {
        return (string) call_user_func('\\Sodium\\randombytes_buf', $numBytes);
    }
    return random_bytes($numBytes);
}