zigzag.js 188 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 module.exports = { encode: function (value) { return (value << 1) ^ (value >> 31); }, decode: function (value) { return (value >> 1) ^ (-(value & 1)); } };