Skip to content

Instantly share code, notes, and snippets.

@calston
Created February 28, 2014 13:04
Show Gist options
  • Save calston/9270704 to your computer and use it in GitHub Desktop.
Save calston/9270704 to your computer and use it in GitHub Desktop.
>>> w = lambda i: base64.b64encode(struct.pack('<d', i).strip('\x00')).strip('=')
>>> [w(i) for i in range(10)]
['', '8D8', 'QA', 'CEA', 'EEA', 'FEA', 'GEA', 'HEA', 'IEA', 'IkA']
>>> [w(i) for i in range(1000,1010)]
['QI9A', 'SI9A', 'UI9A', 'WI9A', 'YI9A', 'aI9A', 'cI9A', 'eI9A', 'gI9A', 'iI9A']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment