Mysql offers a UUID()
function,
which returns an rfc 4122 version 1 guid.
This is an easily guessed timestamp + node_id bit string.
How may we insert randomized version 4 guids?
(Defining a new function requires permissions and is out-of-scope. Ben Johnson offers an expression that is very nice but a little verbose.)
这将插入版本号为4的随机字符串,不带破折号。 为了简洁起见,它仅使用25%的密钥空间, 或120位。