UNPKG

js-isp

Version:

15 lines (14 loc) 556 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUint8ArrayFromHex = exports.ArrayToHexString = void 0; const buffer_1 = require("buffer"); const ArrayToHexString = (byteArray) => { return Array.from(byteArray, function (byte) { return ("0" + (byte & 0xff).toString(16)).slice(-2); }).join(""); }; exports.ArrayToHexString = ArrayToHexString; const getUint8ArrayFromHex = (str) => { return Uint8Array.from(buffer_1.Buffer.from(str, "hex")); }; exports.getUint8ArrayFromHex = getUint8ArrayFromHex;