Created
February 10, 2021 12:03
-
-
Save Alxandr/7c6d204a1b4faf1ac420eb09d78c49a8 to your computer and use it in GitHub Desktop.
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 characters
index = (ulid[0] & 224) >> 5; | |
output[0] = alphabet[index]; | |
index = ulid[0] & 31; | |
output[1] = alphabet[index]; | |
index = (ulid[1] & 248) >> 3; | |
output[2] = alphabet[index]; | |
index = ((ulid[1] & 7) << 2) | ((ulid[2] & 192) >> 6); | |
output[3] = alphabet[index]; | |
index = (ulid[2] & 62) >> 1; | |
output[4] = alphabet[index]; | |
index = ((ulid[2] & 1) << 4) | ((ulid[3] & 240) >> 4); | |
output[5] = alphabet[index]; | |
index = ((ulid[3] & 15) << 1) | ((ulid[4] & 128) >> 7); | |
output[6] = alphabet[index]; | |
index = (ulid[4] & 124) >> 2; | |
output[7] = alphabet[index]; | |
index = ((ulid[4] & 3) << 3) | ((ulid[5] & 224) >> 5); | |
output[8] = alphabet[index]; | |
index = ulid[5] & 31; | |
output[9] = alphabet[index]; | |
index = (ulid[6] & 248) >> 3; | |
output[10] = alphabet[index]; | |
index = ((ulid[6] & 7) << 2) | ((ulid[7] & 192) >> 6); | |
output[11] = alphabet[index]; | |
index = (ulid[7] & 62) >> 1; | |
output[12] = alphabet[index]; | |
index = ((ulid[7] & 1) << 4) | ((ulid[8] & 240) >> 4); | |
output[13] = alphabet[index]; | |
index = ((ulid[8] & 15) << 1) | ((ulid[9] & 128) >> 7); | |
output[14] = alphabet[index]; | |
index = (ulid[9] & 124) >> 2; | |
output[15] = alphabet[index]; | |
index = ((ulid[9] & 3) << 3) | ((ulid[10] & 224) >> 5); | |
output[16] = alphabet[index]; | |
index = ulid[10] & 31; | |
output[17] = alphabet[index]; | |
index = (ulid[11] & 248) >> 3; | |
output[18] = alphabet[index]; | |
index = ((ulid[11] & 7) << 2) | ((ulid[12] & 192) >> 6); | |
output[19] = alphabet[index]; | |
index = (ulid[12] & 62) >> 1; | |
output[20] = alphabet[index]; | |
index = ((ulid[12] & 1) << 4) | ((ulid[13] & 240) >> 4); | |
output[21] = alphabet[index]; | |
index = ((ulid[13] & 15) << 1) | ((ulid[14] & 128) >> 7); | |
output[22] = alphabet[index]; | |
index = (ulid[14] & 124) >> 2; | |
output[23] = alphabet[index]; | |
index = ((ulid[14] & 3) << 3) | ((ulid[15] & 224) >> 5); | |
output[24] = alphabet[index]; | |
index = ulid[15] & 31; | |
output[25] = alphabet[index]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment