UNPKG

@swaptoshi/utils

Version:

Library containing generic utility functions for use with Swaptoshi-related software

13 lines 381 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.numberToBytes = numberToBytes; exports.bytesToNumber = bytesToNumber; function numberToBytes(num) { const buff = Buffer.allocUnsafe(4); buff.writeUIntBE(num, 0, 4); return buff; } function bytesToNumber(buffer) { return buffer.readUIntBE(0, 4); } //# sourceMappingURL=bytes.js.map