OCA_Backend/api/node_modules/wkx/lib/zigzag.js

9 lines
188 B
JavaScript
Raw Normal View History

2022-01-22 13:36:44 +00:00
module.exports = {
encode: function (value) {
return (value << 1) ^ (value >> 31);
},
decode: function (value) {
return (value >> 1) ^ (-(value & 1));
}
};