Last active
June 17, 2024 15:06
-
-
Save lac5/8bdbefab609170196ccbcb4c9b4cc583 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export default function index(...n) { | |
const base = 26; | |
const base0 = base * 10; | |
const aCode = 'a'.charCodeAt(0); | |
const z = String.fromCharCode(base - 1 + aCode); | |
return n.map(function(n) { | |
let ret = String.fromCharCode(Math.floor(n / 10) % base + aCode) + String(Math.floor(n % 10)); | |
while (n >= base0) { | |
ret = z + ret; | |
n -= base0; | |
} | |
return ret; | |
}).join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment