in common/src/main/java/co/elastic/otel/common/util/HexUtils.java [72:92]
public static long hexToLong(CharSequence hex, int offset) {
if (hex.length() - offset < 16) {
throw new IllegalStateException("Provided hex string '" + hex + "' is too short");
}
return hexCharToBinary(hex.charAt(offset)) << 60
| hexCharToBinary(hex.charAt(offset + 1)) << 56
| hexCharToBinary(hex.charAt(offset + 2)) << 52
| hexCharToBinary(hex.charAt(offset + 3)) << 48
| hexCharToBinary(hex.charAt(offset + 4)) << 44
| hexCharToBinary(hex.charAt(offset + 5)) << 40
| hexCharToBinary(hex.charAt(offset + 6)) << 36
| hexCharToBinary(hex.charAt(offset + 7)) << 32
| hexCharToBinary(hex.charAt(offset + 8)) << 28
| hexCharToBinary(hex.charAt(offset + 9)) << 24
| hexCharToBinary(hex.charAt(offset + 10)) << 20
| hexCharToBinary(hex.charAt(offset + 11)) << 16
| hexCharToBinary(hex.charAt(offset + 12)) << 12
| hexCharToBinary(hex.charAt(offset + 13)) << 8
| hexCharToBinary(hex.charAt(offset + 14)) << 4
| hexCharToBinary(hex.charAt(offset + 15));
}