Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getGets = arr => {
- let index = 0
- return () => {
- const toReturn = arr[index]
- index += 1
- return toReturn
- }
- }
- // this is the test
- const test = ['18446744073709551615']
- const gets = this.gets || getGets(test)
- const print = this.print || console.log
- let digits = []
- for (let i = 65; i <= 90; i++) {
- digits.push(String.fromCharCode(i))
- }
- for (let i = 97; i <= 122; i++) {
- for (let j = 65; j <= 90; j++) {
- digits.push(String.fromCharCode(i) + String.fromCharCode(j))
- }
- }
- let n = BigInt(gets())
- let divider = BigInt(256)
- let result = []
- do {
- result.unshift(digits[n % divider])
- n = ~~(n / divider)
- } while (n > 0)
- print(result.join(''))
Add Comment
Please, Sign In to add comment