Created
December 17, 2021 05:52
-
-
Save mr21/204e16b54bfe67a98d784c0cc7179c27 to your computer and use it in GitHub Desktop.
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
function numberBase( n ) { | |
const base = "abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWYXZ"; | |
const len = BigInt( base.length ); | |
let N = BigInt( n ); | |
let s = ""; | |
do { | |
s = base[ N % len ] + s; | |
N = N / len | 0n; | |
} while ( N > 0n ); | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment