Collections:
RANDOM_BYTES() - Generating Random Bytes
How to generates random bytes using the RANDOM_BYTES() function?
✍: FYIcenter.com
RANDOM_BYTES(len) is a MySQL built-in function that
generates random bytes of a given length.
For example:
SELECT HEX(RANDOM_BYTES(16)), HEX(RANDOM_BYTES(16)); -- +----------------------------------+----------------------------------+ -- | HEX(RANDOM_BYTES(16)) | HEX(RANDOM_BYTES(16)) | -- +----------------------------------+----------------------------------+ -- | A81DAEC87FC92E7C630ED06A8AA04842 | 5ECF237CF5C416561665EBD68968B109 | -- +----------------------------------+----------------------------------+
Reference information of the RANDOM_BYTES() function:
RANDOM_BYTES(len): bin generates random bytes of a given length. Arguments, return value and availability: len: Required. The number of bytes to be generated. bin: Return value. The generated byte string. Available since MySQL 4.1.
⇐ MD5() - Calculating MD5 Hash
2023-12-14, 1768🔥, 0💬
Popular Posts:
What Are Out-of-Range Errors with DATETIME values in SQL Server Transact-SQL? When you enter DATETIM...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
How To Revise and Re-Run the Last SQL Command in Oracle? If executed a long SQL statement, found a m...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...
Where to find MySQL database server tutorials? Here is a collection of tutorials, tips and FAQs for ...