Skip to content

Instantly share code, notes, and snippets.

@sean-
Created May 14, 2025 00:47
Show Gist options
  • Select an option

  • Save sean-/c00128fb717c5f2fbe02b1af811ca24b to your computer and use it in GitHub Desktop.

Select an option

Save sean-/c00128fb717c5f2fbe02b1af811ca24b to your computer and use it in GitHub Desktop.
key_uint64 output
mask offset: 11
mask size: 13
hex nibbles: 4
Input Decimal Hex Binary
------- -------------------- ---------------- ----------------------------------------------------------------
orig 0 0000000000000000 0000000000000000000000000000000000000000000000000000000000000000
encoded 0 0000000000000000 0000000000000000000000000000000000000000000000000000000000000000
prefix 0 0000 0000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 1 0000000000000001 0000000000000000000000000000000000000000000000000000000000000001
encoded 1 0000000000000001 0000000000000000000000000000000000000000000000000000000000000001
prefix 0 0000 0000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 2047 00000000000007ff 0000000000000000000000000000000000000000000000000000011111111111
encoded 2047 00000000000007ff 0000000000000000000000000000000000000000000000000000011111111111
prefix 0 0000 0000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 2048 0000000000000800 0000000000000000000000000000000000000000000000000000100000000000
encoded 9223372036854775808 8000000000000000 1000000000000000000000000000000000000000000000000000000000000000
prefix 4096 8000 1000000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 2049 0000000000000801 0000000000000000000000000000000000000000000000000000100000000001
encoded 9223372036854775809 8000000000000001 1000000000000000000000000000000000000000000000000000000000000001
prefix 4096 8000 1000000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 4095 0000000000000fff 0000000000000000000000000000000000000000000000000000111111111111
encoded 9223372036854777855 80000000000007ff 1000000000000000000000000000000000000000000000000000011111111111
prefix 4096 8000 1000000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 4096 0000000000001000 0000000000000000000000000000000000000000000000000001000000000000
encoded 4611686018427387904 4000000000000000 0100000000000000000000000000000000000000000000000000000000000000
prefix 2048 4000 100000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 4097 0000000000001001 0000000000000000000000000000000000000000000000000001000000000001
encoded 4611686018427387905 4000000000000001 0100000000000000000000000000000000000000000000000000000000000001
prefix 2048 4000 100000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 4294967294 00000000fffffffe 0000000000000000000000000000000011111111111111111111111111111110
encoded 18444492273896390654 fff800000007fffe 1111111111111000000000000000000000000000000001111111111111111110
prefix 8191 fff8 1111111111111000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 4294967295 00000000ffffffff 0000000000000000000000000000000011111111111111111111111111111111
encoded 18444492273896390655 fff800000007ffff 1111111111111000000000000000000000000000000001111111111111111111
prefix 8191 fff8 1111111111111000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 4294967296 0000000100000000 0000000000000000000000000000000100000000000000000000000000000000
encoded 524288 0000000000080000 0000000000000000000000000000000000000000000010000000000000000000
prefix 0 0000 0000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 81985529216486894 0123456789abcdee 0000000100100011010001010110011110001001101010111100110111101110
encoded 11432397662079176174 9ea8091a2b3c4dee 1001111010101000000010010001101000101011001111000100110111101110
prefix 5077 9ea8 1001111010101000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 81985529216486895 0123456789abcdef 0000000100100011010001010110011110001001101010111100110111101111
encoded 11432397662079176175 9ea8091a2b3c4def 1001111010101000000010010001101000101011001111000100110111101111
prefix 5077 9ea8 1001111010101000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 81985529216486896 0123456789abcdf0 0000000100100011010001010110011110001001101010111100110111110000
encoded 11432397662079176176 9ea8091a2b3c4df0 1001111010101000000010010001101000101011001111000100110111110000
prefix 5077 9ea8 1001111010101000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 18446744073709551614 fffffffffffffffe 1111111111111111111111111111111111111111111111111111111111111110
encoded 18446744073709551614 fffffffffffffffe 1111111111111111111111111111111111111111111111111111111111111110
prefix 8191 fff8 1111111111111000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 18446744073709551615 ffffffffffffffff 1111111111111111111111111111111111111111111111111111111111111111
encoded 18446744073709551615 ffffffffffffffff 1111111111111111111111111111111111111111111111111111111111111111
prefix 8191 fff8 1111111111111000
------- -------------------- ---------------- ----------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment