aboutsummaryrefslogtreecommitdiffstats
path: root/pet_names
blob: e91fe1d2597d6e2a486bcac55335fc37ba5a7aaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
# SPDX-License-Identifier: CDDL-1.0
# Copyright (c) 2020, 2021 Daniel Washburn <daniel@washburn.at>

from hex2words import hex2words
from secrets import token_hex
import sys

def main(argv):
    try:
        names = int(argv[1])
    except:
        names = 1
    try:
        nbytes = int(argv[2])
    except:
        nbytes = 2

    for i in range(names):
        tok = token_hex(nbytes)
        print("_".join(hex2words.hex2words(tok).lower().split()))

if __name__ == "__main__":
    main(sys.argv)