2021-12-09 10:42:54 +00:00
|
|
|
-- length should be 32
|
|
|
|
select length(hex(generateUUIDv4()));
|
|
|
|
|
|
|
|
with generateUUIDv4() as uuid,
|
2022-01-19 09:15:36 +00:00
|
|
|
replace(toString(uuid), '-', '') as str1,
|
|
|
|
lower(hex(uuid)) as str2
|
2021-12-09 10:42:54 +00:00
|
|
|
select str1 = str2;
|
|
|
|
|
|
|
|
-- hex on UUID always generate 32 characters even there're leading zeros
|
|
|
|
select lower(hex(toUUID('00000000-80e7-46f8-0000-9d773a2fd319')));
|
|
|
|
|
2022-01-19 09:15:36 +00:00
|
|
|
-- length should be 128
|
|
|
|
select length(bin(generateUUIDv4()));
|
2021-12-09 10:42:54 +00:00
|
|
|
|
|
|
|
-- bin on UUID always generate 128 characters even there're leading zeros
|
2022-01-19 09:15:36 +00:00
|
|
|
select bin(toUUID('00000000-80e7-46f8-0000-9d773a2fd319'));
|