Files
explore/lib/hexToBytes.ts
T
2022-10-07 14:31:11 +03:00

8 lines
191 B
TypeScript

export default function hexToBytes(hex: string) {
const bytes = [];
for (let c = 0; c < hex.length; c += 2) {
bytes.push(parseInt(hex.substring(c, c + 2), 16));
}
return bytes;
}