Skip to content

limb64FromBigInt

limb64FromBigInt(value, limbWords): BigUint64Array

Defined in: limb64/from-big-int.ts:17

Encodes a non-negative bigint into a fresh limbWords-length limb array, least significant limb first.

Unlike limb32FromBigInt this refuses to truncate: a fixed-width modular kernel that silently dropped the top of a modulus would compute in the wrong ring, so overflow is an error rather than a wrap.

Time complexity: O(limbWords).

bigint

A non-negative bigint that fits in limbWords limbs.

number

The destination width, in 64-bit limbs.

BigUint64Array

When value is negative or does not fit.