Decodes a hex string into bytes.
decode(string)
string
A hex-encoded string. Any letter case is allowed.
A Uint8Array with decoded bytes.
Throws an error if the string is not a valid hex string.
hex.decode("FF121B")
Uint8Array [255, 18, 27]
hex.decode("fF121b")
Uint8Array [255, 18, 27]
hex.decode("fF121")
Error: hex: invalid length for decoding