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
| function intToBase16(num) { | |
| if (num === 0) return '0' | |
| const digits = Array.from(new Array(16), (_, i) => i < 10 ? i : String.fromCharCode(65 + i - 10)) | |
| let base16 = '' | |
| while (num !== 0) { | |
| base16 = digits[num % 16] + base16 | |
| num = Math.floor(num / 16) | |
| } | |
| return base16 | |
| } |
OlderNewer