Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function bigint2sig(i, bits) {
const j = i.isNegative() ? bigInt.one.shiftLeft(Math.max(i.bitLength().toJSNumber()+2, bits)).plus(i) : i;
return Vector3vl.fromArray(j.toArray(2).value
.reverse()
.map(x => (x<<1)-1)
.concat(Array(bits).fill(-1))
.slice(0, bits));
}