aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils/address_utils.ts
blob: a9fb6921a4e34d340d8ba3a06336978f15176bd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import { crypto, generatePseudoRandomSalt } from '@0xproject/order-utils';

export const addressUtils = {
    generatePseudoRandomAddress(): string {
        const randomBigNum = generatePseudoRandomSalt();
        const randomBuff = crypto.solSHA3([randomBigNum]);
        const randomAddress = `0x${randomBuff.slice(0, 20).toString('hex')}`;
        return randomAddress;
    },
};