scripts: add bcrypt script

This commit is contained in:
lelgenio 2025-09-17 17:47:38 -03:00
parent 7a95706af2
commit 99d57ba005
3 changed files with 19 additions and 0 deletions

17
scripts/bcrypt Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
set -euo pipefail
if [ "$#" = 0 ]; then
echo "Usage: $0 [passwords...] | $0 - < passwords.txt" >&2
exit 1
fi
if [ "$1" = '-' ]; then
xargs -x -n1 -d'\n' htpasswd -bnBC 10 "" | tr -d ':' | sed '/^$/d'
else
for pass in "$@"; do
htpasswd -bnBC 10 "" "$pass" | tr -d ':' | sed '/^$/d'
done
fi

View file

@ -54,6 +54,7 @@
_diffr
];
helix-man-pager = [ helix-pager ];
bcrypt = [ apacheHttpd ];
musmenu = [
mpc-cli
wdmenu