* @param {Uint8Array} bytes - Byte array to convert\r
* @returns {string} Hexadecimal string representation of the input bytes\r
*/\r
- static toHex (bytes: Uint8Array): string {\r
+ static toHex (bytes: ArrayBuffer | Uint8Array): string {\r
+ if (bytes instanceof ArrayBuffer) bytes = new Uint8Array(bytes)\r
if (bytes.buffer instanceof ArrayBuffer && bytes.buffer.detached) return ''\r
return [...bytes]\r
.map(byte => byte.toString(16).padStart(2, '0'))\r