UNPKG

hex-lite

Version:

isomorphic hex library in 256 bytes

3 lines (2 loc) 359 B
function r(r){return Buffer.from(r).toString("hex")}function n(r){if(r.length%2)throw new Error("invalid hex:"+r);return new Uint8Array(Buffer.from(r,"hex"))}function t(n){return r(new Uint8Array(n))}function e(r){return n(r).buffer}exports.fromUint8Array=r,exports.toUint8Array=n,exports.fromBuffer=t,exports.toBuffer=e; //# sourceMappingURL=hex-lite.js.map