This commit is contained in:
thek4n 2024-11-22 00:10:19 +03:00
parent 08b8449fe5
commit e364188ba9
2 changed files with 11 additions and 2 deletions

View File

@ -59,7 +59,6 @@ alias h='history 0'
alias j='jobs -l'
# utils
alias sha='(shasum -a 256 | head -c 64)'
alias genpass="openssl rand -base64 12"
alias gensalt="dd if=/dev/urandom count=16 2>/dev/null | sha256sum | head -c 64"

View File

@ -283,4 +283,14 @@ mirror-site() (
--reject '*.woff*,*.ttf,*.eot,*.js' \
--tries 10 \
$@
)
)
sha() {
if [ -v 2 ]; then
shasum -a 256 "${@}"
elif [ -v 1 ]; then
shasum -a 256 "${@}" | head -c 64
else
shasum -a 256 | head -c 64
fi
}