Created
May 22, 2009 15:31
-
-
Save nevali/116196 to your computer and use it in GitHub Desktop.
int64_to_base36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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