Skip to content

@lelantos-org/sdk / primitives / randomFr

Function: randomFr() ​

ts
function randomFr(): bigint;

Defined in: @lelantos-org/sdk/dist/core/random.d.ts:18

Uniform Fr (BN254 scalar field), non-zero.

The mask keeps the draw in [0, 2^254), which must stay >= BN254_FR or the rejection loop would sample a truncated range; MASK_BOUNDS in random.test.ts pins that. The mask only raises the acceptance rate.

Returns ​

bigint