aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/random.ts
blob: 605471ac9eeba82931630f0420cbaab318730151 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import {
  NumberDictionary,
  animals,
  colors,
  uniqueNamesGenerator,
} from "unique-names-generator";

export const randomName = () =>
  uniqueNamesGenerator({
    dictionaries: [animals, NumberDictionary.generate({ min: 10, max: 99 })],
    length: 2,
    separator: "",
  });

export const randomPassword = () =>
  uniqueNamesGenerator({
    dictionaries: [colors, NumberDictionary.generate({ min: 100, max: 999 })],
    length: 2,
    separator: "",
  });