We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18df33c commit c8f1a4dCopy full SHA for c8f1a4d
1 file changed
src/utils/bytes.ts
@@ -21,8 +21,11 @@
21
* @copyright SKALE Labs 2026-Present
22
*/
23
24
+import { validateHexString } from './helper';
25
+
26
export function hexToBytes(hex: string): Uint8Array {
27
const sanitizedHex = hex.startsWith('0x') ? hex.slice(2) : hex;
28
+ validateHexString(sanitizedHex);
29
const bytes = new Uint8Array(sanitizedHex.length / 2);
30
31
for (let i = 0; i < sanitizedHex.length; i += 2) {
0 commit comments