mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-10 11:26:58 +00:00
feat: hexToBytes can handle Ethereum address with case checksum
This commit is contained in:
parent
528bb19425
commit
3053d27b2c
@ -9,7 +9,7 @@ import { toString } from "uint8arrays/to-string";
|
|||||||
export function hexToBytes(hex: string | Uint8Array): Uint8Array {
|
export function hexToBytes(hex: string | Uint8Array): Uint8Array {
|
||||||
if (typeof hex === "string") {
|
if (typeof hex === "string") {
|
||||||
const _hex = hex.replace(/^0x/i, "");
|
const _hex = hex.replace(/^0x/i, "");
|
||||||
return fromString(_hex, "base16");
|
return fromString(_hex.toLowerCase(), "base16");
|
||||||
}
|
}
|
||||||
return hex;
|
return hex;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user