Skip to content

Instantly share code, notes, and snippets.

@nevali
Created May 22, 2009 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevali/116196 to your computer and use it in GitHub Desktop.
Save nevali/116196 to your computer and use it in GitHub Desktop.
int64_to_base36
char *
int64_to_base36(uint32_t src, char *buf)
{
const char base36[] = "0123456789abcdefghijklmnopqrstuvwxyz";
int c;
c = 0;
while(src)
{
fprintf(stderr, "%02d: src = 0x%016x (%llu), r = %d\n", c, src, src, src % 36);
*buf = base36[src % 36];
buf++;
src /= (uint64_t) 36;
c++;
}
*buf = 0;
return buf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment