I am attempting to encrypt a string using random bytes and sodium in PHP 7.2.7 for IIS.
$nonce = random_bytes('SODIUM_CRYPTO_SECRETBOX_NONCEBYTES');
and
$nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
both return this error:
Uncaught TypeError: random_bytes() expects parameter 1 to be integer
however this works fine
$key = random_bytes('SODIUM_CRYPTO_SECRETBOX_KEYBYTES');
Google seems to be failing me with this one, I have found no help when searching.