Convert a hexadecimal string to a Uint8Array.
A hex string (must have even length, case-insensitive)
The decoded byte array
If the hex string has odd length or contains invalid characters
hexToBytes("deadbeef"); // Uint8Array([0xde, 0xad, 0xbe, 0xef])hexToBytes("DEADBEEF"); // Uint8Array([0xde, 0xad, 0xbe, 0xef])hexToBytes("xyz"); // throws Error: Invalid hex string Copy
hexToBytes("deadbeef"); // Uint8Array([0xde, 0xad, 0xbe, 0xef])hexToBytes("DEADBEEF"); // Uint8Array([0xde, 0xad, 0xbe, 0xef])hexToBytes("xyz"); // throws Error: Invalid hex string
Convert a hexadecimal string to a Uint8Array.