tdiceware - hashcrush - Compute Argon2id hashes
 (HTM) git clone git://git.z3bra.org/hashcrush.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
       tdiceware (388B)
       ---
            1 #!/bin/sh
            2 
            3 usage() {
            4         echo "usage: $(basename $0) -f wordlist [-c count]"
            5 }
            6 
            7 roll() {
            8         tr -cd 1-6 </dev/urandom \
            9                 | fold -w 5 \
           10                 | head -n ${count} \
           11                 | tr '\n' '|' \
           12                 | sed 's,|$,,'
           13 }
           14 
           15 count=5
           16 while getopts 'c:f:h' OPT; do
           17         case $OPT in
           18         c) count=$OPTARG;;
           19         f) dict=$OPTARG;;
           20         h) usage; exit 0;;
           21         *) usage; exit 1;;
           22         esac
           23 done
           24 
           25 echo $(grep -E "^($(roll ${count}))" $dict | cut -f2)