commit adb397d0e38e75d9485b8068e247a133534c0108 from: boredpasta date: Thu Jun 5 14:38:15 2025 UTC gen, entropy: amend description and add set -e commit - 7031709658b05ece4b9c1ae10e12fc64b42f24c3 commit + adb397d0e38e75d9485b8068e247a133534c0108 blob - 300fb705b49ff26af3788495b9f7cb011952700f blob + 12be2d433580ce2ddcac52ad14c28e55956e0260 --- entropy +++ entropy @@ -1,6 +1,7 @@ #!/bin/sh -# entropy: calculates the entropy of a password given the length and number of -# possiblities +# entropy: calculates the entropy of a password given the password length and +# number of possiblities +set -e num=0 [ "$1" = '-n' ] && { num=1; shift; } blob - 6d44a0698f163b8618bc369d50ac17519ce7189e blob + fec35b244d18df3a3fad441c9fb3e58c17ef0ed9 --- gen +++ gen @@ -1,5 +1,10 @@ #!/bin/sh # generate passwordssss +# range is from ascii space (32) to tilde (126) -> 126-32=96 possibilities +# which yeilds 256+ bits of entropy at a password length of 40 (can be +# calculatedwith `entropy 96 40') +set -e + length=40 [ "$#" -gt 1 ] && { echo "usage: ${0##*/} [length]" 1>&2; exit 1; } [ "$#" -eq 1 ] && length=$1