Added all remaining gists.
This commit is contained in:
1
hash.sh/README.md
Normal file
1
hash.sh/README.md
Normal file
@@ -0,0 +1 @@
|
||||
A little toy shell script inspired by Bitcoin mining.
|
||||
13
hash.sh/hash.sh
Normal file
13
hash.sh/hash.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
VAL="0"
|
||||
|
||||
while :
|
||||
do
|
||||
echo `cat $1` "$VAL" | sha256sum | sha256sum | grep "^0\{$2\}"
|
||||
if [[ $? -eq 0 ]]
|
||||
then
|
||||
break
|
||||
fi
|
||||
VAL=`expr $VAL + "1"`
|
||||
done
|
||||
Reference in New Issue
Block a user