Skip to content

Instantly share code, notes, and snippets.

@FirePanther
Last active November 17, 2016 03:50
Show Gist options
  • Save FirePanther/f7d71386750a40492e23 to your computer and use it in GitHub Desktop.
Save FirePanther/f7d71386750a40492e23 to your computer and use it in GitHub Desktop.
Generator string by the codec chars
function int2str(integer, codec) {
var clen = codec.length, string = "", mod;
while (integer > 0) {
mod = integer % clen;
string = codec[mod] + string;
integer = (integer - mod) / clen;
}
return string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment