@gmod/bam
Version:
Parser for BAM and BAM index (bai) files
18 lines • 699 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TWO_PWR_32_DBL = exports.TWO_PWR_16_DBL = void 0;
exports.longFromBytesToUnsigned = longFromBytesToUnsigned;
exports.TWO_PWR_16_DBL = 1 << 16;
exports.TWO_PWR_32_DBL = exports.TWO_PWR_16_DBL * exports.TWO_PWR_16_DBL;
function longFromBytesToUnsigned(source, i = 0) {
const low = source[i] |
(source[i + 1] << 8) |
(source[i + 2] << 16) |
(source[i + 3] << 24);
const high = source[i + 4] |
(source[i + 5] << 8) |
(source[i + 6] << 16) |
(source[i + 7] << 24);
return (high >>> 0) * exports.TWO_PWR_32_DBL + (low >>> 0);
}
//# sourceMappingURL=long.js.map