Last active
March 28, 2022 13:20
-
-
Save Conaclos/865c86faeeeaab988ac0f753f6e07dad to your computer and use it in GitHub Desktop.
Revisions
-
Conaclos revised this gist
Mar 28, 2022 . 1 changed file with 20 additions and 20 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,24 +2,24 @@ The following SQL statement enables to generate a base64 uuid encoded on 96bits ```sql SELECT (substr(chars, (first & 63)+1, 1) || substr(chars, ((first >> 6) & 63)+1, 1) || substr(chars, ((first >> 12) & 63)+1, 1) || substr(chars, ((first >> 18) & 63)+1, 1) || substr(chars, ((first >> 24) & 63)+1, 1) || substr(chars, ((first >> 30) & 63)+1, 1) || substr(chars, ((first >> 36) & 63)+1, 1) || substr(chars, ((first >> 42) & 63)+1, 1) || substr(chars, (second & 63)+1, 1) || substr(chars, ((second >> 6) & 63)+1, 1) || substr(chars, ((second >> 12) & 63)+1, 1) || substr(chars, ((second >> 18) & 63)+1, 1) || substr(chars, ((second >> 24) & 63)+1, 1) || substr(chars, ((second >> 30) & 63)+1, 1) || substr(chars, ((second >> 36) & 63)+1, 1) || substr(chars, ((second >> 42) & 63)+1, 1)) as uuid FROM ( SELECT 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' as chars, random() as first, random() as second ); ``` -
Conaclos revised this gist
Mar 28, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ SELECT (substr(chars, (first & 63)+1, 1) || substr(chars, ((second >> 42) & 63)+1, 1)) as uuid FROM ( SELECT 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' as chars, random() as first, random() as second ); ``` -
Conaclos created this gist
Mar 28, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ The following SQL statement enables to generate a base64 uuid encoded on 96bits (12 octects). ```sql SELECT (substr(chars, (first & 63)+1, 1) || substr(chars, ((first >> 6) & 63)+1, 1) || substr(chars, ((first >> 12) & 63)+1, 1) || substr(chars, ((first >> 18) & 63)+1, 1) || substr(chars, ((first >> 24) & 63)+1, 1) || substr(chars, ((first >> 30) & 63)+1, 1) || substr(chars, ((first >> 36) & 63)+1, 1) || substr(chars, ((first >> 42) & 63)+1, 1) || substr(chars, (second & 63)+1, 1) || substr(chars, ((second >> 6) & 63)+1, 1) || substr(chars, ((second >> 12) & 63)+1, 1) || substr(chars, ((second >> 18) & 63)+1, 1) || substr(chars, ((second >> 24) & 63)+1, 1) || substr(chars, ((second >> 30) & 63)+1, 1) || substr(chars, ((second >> 36) & 63)+1, 1) || substr(chars, ((second >> 42) & 63)+1, 1)) as uuid FROM ( SELECT 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' as chars, random() as first, random() as second ); ```