UNPKG

@creditkarma/thrift-server-core

Version:
44 lines 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.writeDoubleLE = exports.readDoubleLE = exports.writeDouble = exports.writeI32 = exports.writeI16 = exports.readDouble = exports.readI32 = exports.readI16 = exports.readByte = void 0; function readByte(byte) { return byte > 127 ? byte - 256 : byte; } exports.readByte = readByte; function readI16(bytes, offset = 0) { return bytes.readInt16BE(offset); } exports.readI16 = readI16; function readI32(bytes, offset = 0) { return bytes.readInt32BE(offset); } exports.readI32 = readI32; function readDouble(bytes, offset = 0) { return bytes.readDoubleBE(offset); } exports.readDouble = readDouble; function writeI16(bytes, i16) { bytes.writeInt16BE(i16, 0); return bytes; } exports.writeI16 = writeI16; function writeI32(bytes, i32) { bytes.writeInt32BE(i32, 0); return bytes; } exports.writeI32 = writeI32; function writeDouble(bytes, dub) { bytes.writeDoubleBE(dub, 0); return bytes; } exports.writeDouble = writeDouble; function readDoubleLE(bytes, offset = 0) { return bytes.readDoubleLE(offset); } exports.readDoubleLE = readDoubleLE; function writeDoubleLE(bytes, dub) { bytes.writeDoubleLE(dub, 0); return bytes; } exports.writeDoubleLE = writeDoubleLE; //# sourceMappingURL=binary.js.map