Buffer is subclass of Uint8Array

This commit is contained in:
dapplion 2020-11-25 17:56:33 +00:00
parent ca5cac64b3
commit e32ea6d7a5
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ export function assert(condition: unknown, message = "Assertion failed"): assert
}
export function hexToBytes(hex: string): Uint8Array {
return Uint8Array.from(Buffer.from(hex.replace("0x", ""), "hex"));
return Buffer.from(hex.replace("0x", ""), "hex");
}
export function bytesToHex(bytes: Uint8Array): string {