Function: randomFelt()
randomFelt():
string
Defined in: src/utils/stark/index.ts:140
Random felt.
A felt is an integer in the range [0, PRIME), PRIME being 2251 + 17 * 2192 + 1. Every value of this range has the same probability to be returned.
Use it when a value only has to be unpredictable : a deployment salt, a SNIP-9 nonce, a test value. Do not use it as a private key : the range of a private key is narrower than the range of a felt (see randomStarkPrivateKey).
Returns
string
an hex string of a random felt
Example
const result = stark.randomFelt();
// result = "0x51fc8126a13cd5ddb29a71ca399cb1e814f086f5af1b502d7151c14929554f"