@taquito/signer
Version:
Provide signing functionality to be with taquito
17 lines (16 loc) • 466 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseHex = parseHex;
const core_1 = require("@taquito/core");
function parseHex(s) {
const res = [];
for (let i = 0; i < s.length; i += 2) {
const ss = s.slice(i, i + 2);
const x = parseInt(ss, 16);
if (Number.isNaN(x)) {
throw new core_1.InvalidHexStringError(ss);
}
res.push(x);
}
return new Uint8Array(res);
}
;