Skip to content

Instantly share code, notes, and snippets.

View wkei's full-sized avatar
📷
"click"

Kei wkei

📷
"click"
View GitHub Profile
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
}