Created
June 24, 2025 09:31
-
-
Save drscream/7ce7e83c4992cefe2e55317d14e68588 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFS= read -r -d '' _ < <(:);: ${1:?Usage: $0 string} | |
exec {FD}<> <(:) | |
trap 'exit' ERR | |
s=0;while read -rn1 <&$FD;do : "${_:-${REPLY}}";((s+=`printf "%d" "'$REPLY"`));done < <(<<<"$1" tee /dev/fd/$FD >/dev/null) | |
: ${_:=`echo $RANDOM | md5sum | cut -c1-8`} | |
printf 'Checksum of "%s" is: %s\n' "$1" "$s" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment