(PHP 8 >= 8.1.0)
sodium_crypto_stream_xchacha20_keygen — Returns a secure random key
sodium_crypto_stream_xchacha20_keygen(): string
Returns a secure random key for use with sodium_crypto_stream_xchacha20().
This function has no parameters.
Returns a 32-byte secure random key for use with sodium_crypto_stream_xchacha20().
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/function.sodium-crypto-stream-xchacha20-keygen.php