feat: hexToBytes can handle Ethereum address with case checksum

This commit is contained in:
fryorcraken.eth 2022-08-29 16:37:05 +10:00
parent 528bb19425
commit 3053d27b2c
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import { toString } from "uint8arrays/to-string";
export function hexToBytes(hex: string | Uint8Array): Uint8Array {
if (typeof hex === "string") {
const _hex = hex.replace(/^0x/i, "");
return fromString(_hex, "base16");
return fromString(_hex.toLowerCase(), "base16");
}
return hex;
}