out[i >> 1] = (decodeHexChar(hex, i++) << 4) | decodeHexChar(hex, i++);
}
}
function decodeHexChar(str: string, position: number) {
const s = str.charCodeAt(position);
if (s >= 48 && s <= 57) { // '0'-'9'
} else if (s >= 97 && s <= 102) { // 'a'-'f'
return s - 87;