DNDQoteGrabber/node_modules/magic-bytes.js/dist/model/toHex.js

9 lines
357 B
JavaScript
Raw Normal View History

2023-12-20 14:09:06 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromHex = exports.toHex = void 0;
const hex = (num) => new Number(num).toString(16).toLowerCase();
const toHex = (num) => `0x${hex(num).length === 1 ? "0" + hex(num) : hex(num)}`;
exports.toHex = toHex;
const fromHex = (hex) => new Number(hex);
exports.fromHex = fromHex;