1

Tweet IDs are 64 bit decimals stored as strings since JavaScript cannot handle 64 bit integers. I want to store my Tweets in a Database as JSON using the ID as the key. To keep the database small, I want to optimize my ID length. JSON is UTF-8 with a few restricted characters. So, Base64 is probably best (a-z,A-Z,0-9, $, #).

What's a robust way to do this? Note, I will need to encode and decode and I am using Node.js so I probably need to leave it as a string when I encode.

Tweet ID Example: 112652479837110273

Justin Elkow
  • 2,833
  • 6
  • 28
  • 60

0 Answers0