Push should be converted to hexout. unshift
This commit is contained in:
fecqs
2020-06-26 21:57:39 +08:00
committed by GitHub
parent 4d4f668451
commit 129ec51861

View File

@ -13,7 +13,7 @@ function intToHex (num) {
function decimalToHex (num) {
const hexOut = []
while (num > 15) {
hexOut.push(intToHex(num % 16))
hexOut.unshift(intToHex(num % 16))
num = Math.floor(num / 16)
}
return intToHex(num) + hexOut.join('')