xen-orchestra/packages/vhd-lib/_bitmap.js
2022-02-22 12:34:41 +01:00

10 lines
176 B
JavaScript

'use strict'
const MASK = 0x80
exports.set = (map, bit) => {
map[bit >> 3] |= MASK >> (bit & 7)
}
exports.test = (map, bit) => ((map[bit >> 3] << (bit & 7)) & MASK) !== 0