mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-25 10:35:51 +00:00
Merge pull request #911 from status-im/lower-case-hex
This commit is contained in:
commit
aa40959375
@ -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