A 3d thing

@EugeneRedwing8 see my answer here:

or if you just want to convert one number:

const hexChars = "0123456789ABCDEF";

function toHex(int: number) {
    return toHexByte(int >> 24) + toHexByte((int >> 16) & 0xffff) + toHexByte((int >> 8) & 0xffff) + toHexByte(int & 0xffff)
}

function toHexByte(byte: number) {
    return hexChars.charAt(byte >> 4) + hexChars.charAt(byte & 0xf);
}
2 Likes