annotate bin/pwgen @ 719:bcdf320dabf4

Rewrite the ed2k again in php Getting openssl to hash md4 is a pain.
author nanaya <me@nanaya.net>
date Sun, 10 Dec 2023 00:35:22 +0900
parents bdc9eddf3743
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
651
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
1 #!/bin/sh
478
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
2
651
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
3 set -e
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
4 set -u
478
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
5
651
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
6 _length="${1:-12}"
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
7
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
8 for i in 1 2 3 4 5; do
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
9 printf "%s: " "$i"
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
10 openssl rand -base64 "$_length" | tr '/+' '-_' | cut -c "1-$_length"
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
11 done