How to use the 3vl.Vector3vl.fromArray function in 3vl

To help you get started, we’ve selected a few 3vl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tilk / digitaljs / src / help.js View on Github external
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));
}