You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TEMP FUNCTION GENERATE_UUID_V5(Reference STRING, namespace_in_bytes BYTES)
RETURNS STRING
AS (
FORMAT_UUID(
TO_HEX(
CAST(
TO_HEX(LEFT(SHA1(CONCAT(namespace_in_bytes, CAST(Reference AS BYTES FORMAT 'UTF8'))), 16)) AS BYTES FORMAT 'HEX') & CAST('ffffffffffff0fff3fffffffffffffff' AS BYTES FORMAT 'HEX') | CAST('00000000000050008000000000000000'
AS BYTES FORMAT 'HEX')
)
)
);
SELECT
reference,
GENERATE_UUID_V5(reference, NAMESPACE_OID_IN_BYTES) AS UUID