Skip to content

Commit

Permalink
utils: add random generators
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed Sep 16, 2024
1 parent e681166 commit e5339ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/random.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { utils } from 'ethers'

export function randomAddress(): string {
return randomHex(20)
}

export function randomHex(length: number): string {
return utils.hexlify(utils.randomBytes(length))
}

0 comments on commit e5339ca

Please sign in to comment.