aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/salt.ts
blob: a7cc4aea050e31eaaf7cb80fb71304fd6053ba56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { BigNumber, generatePseudoRandom256BitNumber } from '@0x/utils';

/**
 * Generates a pseudo-random 256-bit salt.
 * The salt can be included in a 0x order, ensuring that the order generates a unique orderHash
 * and will not collide with other outstanding orders that are identical in all other parameters.
 * @return  A pseudo-random 256-bit number that can be used as a salt.
 */
export function generatePseudoRandomSalt(): BigNumber {
    const salt = generatePseudoRandom256BitNumber();
    return salt;
}