Skip to content

Instantly share code, notes, and snippets.

@antirez
Created December 6, 2015 12:54
Show Gist options
  • Save antirez/e0536fb1dde09dd625fd to your computer and use it in GitHub Desktop.
Save antirez/e0536fb1dde09dd625fd to your computer and use it in GitHub Desktop.
FROM: DI0f0c644fd3ccb51c2cedbd47fcb6f312646c993c05a0SQ
TO:
Proposal 1: DI0f0c644f:d3ccb51c2cedbd47fcb6f312646c993c:05a0SQ (two ":" added)
Proposal 2: DId3ccb51c2cedbd47fcb6f312646c993c0f0c644f05a0SQ (Node and Message ID inverted)
Proposal 3: D[d3ccb51c2cedbd47fcb6f312646c993c]0f0c644f05a0Q (D and Q only for validity check, [] around Message ID)
@antirez
Copy link
Author

antirez commented Dec 7, 2015

Thanks for your help, we have a winner based on @mp311de proposal with changes to make it shorter and more future proof. So this is the new ID:

D-dcb833cf-axzAwPMGBuogYEg6Omgrq090-05a1A$

Remarks:

  1. The node part is at the same offset as it used to be in the past.
  2. Random part is in base64, so now there is room for 144 bits of entropy.
  3. After the TTL there is a reserved byte for future uses "A". It is set to "A" since it's the logical zero in the base64 encoding.
  4. There is an ID terminator "$"
  5. The ID is just 42 bytes long. Shorter than the original IDs.

Looks like a good compromise among the things we needed. Code is available in the newid branches. I'll merge soon. Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment