type Bytes = Uint8Array<ArrayBuffer> | Buffer<ArrayBuffer>
type Hex = HexByte[]
type HexByte = `${HexChar}${HexChar}`
- type HexChar = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
+ type HexChar = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
}
export {
* @returns True if input is hex, else false
*/
is (input: unknown): input is Hex {
- return typeof input === 'string' && /^([0-9a-f]{2})+$/.test(input)
+ return typeof input === 'string' && /^([0-9A-F]{2})+$/i.test(input)
},
/**