RANDOM_BYTES

MariaDB starting with 10.10.0

The RANDOM_BYTES function generates a binary string of random bytes. It was added in MariaDB 10.10.0.

Syntax

RANDOM_BYTES(length)

Description

Given a length from 1 to 1024, generates a binary string of length consisting of random bytes generated by the SSL library's random number generator.

See the RAND_bytes() function documentation of your SSL library for information on the random number generator. In the case of OpenSSL, a cryptographically secure pseudo random generator (CSPRNG) is used.

Statements containing the RANDOM_BYTES function are unsafe for statement-based replication.

An error occurs if length is outside the range 1 to 1024.

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?