@gmod/bam
Version:
Parser for BAM and BAM index (bai) files
17 lines • 589 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.longFromBytesToUnsigned = longFromBytesToUnsigned;
const TWO_PWR_32_DBL = 2 ** 32;
// avoids dependency on long.js
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) * TWO_PWR_32_DBL + (low >>> 0);
}
//# sourceMappingURL=long.js.map