top of page
CerebroSQL

RANDOM_BYTES

База данных: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

Syntax:
RANDOM_BYTES(len)

This function returns a binary string of len random bytes generated
using the random number generator of the SSL library. Permitted values
of len range from 1 to 1024. For values outside that range, an error
occurs.

RANDOM_BYTES() can be used to provide the initialization vector for the
AES_DECRYPT() and AES_ENCRYPT() functions. For use in that context, len
must be at least 16. Larger values are permitted, but bytes in excess
of 16 are ignored.

RANDOM_BYTES() generates a random value, which makes its result
nondeterministic. Consequently, statements that use this function are
unsafe for statement-based replication.

URL: https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html

Example

bottom of page