$ openssl dgst -sha256 -hex <<< "hello, world"
853ff93762a06ddbf722c4ebe9ddd66d8f63ddaea97f521c3ecc20da7c976020
$
Cheers,
different version of openssl I guess.
$ openssl version
OpenSSL 1.0.0c 2 Dec 2010
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
$ openssl dgst -sha256 -hex <<< "hello, world"
853ff93762a06ddbf722c4ebe9ddd66d8f63ddaea97f521c3ecc20da7c976020
$
$ openssl dgst -sha256 -hex <<< "hello, world"
853ff93762a06ddbf722c4ebe9ddd66d8f63ddaea97f521c3ecc20da7c976020
$
{ bigEndianHex2littleEndianHex <<<"$a" | xxd -p -r ;
bigEndianHex2littleEndianHex <<<"$b" | xxd -p -r ; } \
| openssl dgst -sha256 -binary \
| openssl dgst -sha256 -hex \
| bigEndianHex2littleEndianHex
{ bigEndianHex2littleEndianHex <<<"$a" | xxd -p -r ;
bigEndianHex2littleEndianHex <<<"$b" | xxd -p -r ; } |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
sed 's/.* //' |
bigEndianHex2littleEndianHex
{ bigEndianHex2littleEndianHex <<<"$a" |xxd -p -r ; bigEndianHex2littleEndianHex <<<"$b" |xxd -p -r ; } |openssl dgst -sha256 -hex
{ bigEndianHex2littleEndianHex <<<"$a" | xxd -p -r ;
bigEndianHex2littleEndianHex <<<"$b" | xxd -p -r ; } \
| openssl dgst -sha256 -binary \
| openssl dgst -sha256 -hex \
| bigEndianHex2littleEndianHex
echo "A 1" |xxd -p -r |xxd -p
a1
echo -n "A 1" |xxd -p -r |xxd -p
a1
$ sha256sum e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -
$ sha256sum <<< ''
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -
$ printf '\n' | sha256sum
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -
$ hexdump -C <<< a
00000000 61 0a |a.|
00000002
$
{ bigEndianHex2littleEndianHex <<<"$a" |xxd -p -r ; bigEndianHex2littleEndianHex <<<"$b" |xxd -p -r ; } |openssl dgst -sha256 -hex
$ sha256sum e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -
$ sha256sum <<< ''
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -
$ printf '\n' | sha256sum
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -
$ hexdump -C <<< a
00000000 61 0a |a.|
00000002
$
{ bigEndianHex2littleEndianHex <<<"$a" |xxd -p -r ; bigEndianHex2littleEndianHex <<<"$b" |xxd -p -r ; } |openssl dgst -sha256 -hex
diff --git a/bashhash.sh b/bashhash.sh
index a99bf9d..1bddd92 100644
--- a/bashhash.sh
+++ b/bashhash.sh
@@ -24,8 +24,8 @@ time=1231006505
bits=486604799
nonce=2083236893
-printf "%8x%8x%8x%64s%64s%8x" $nonce $bits $time $mrkl_root $prev_block $ver |
-sed 's/ /0/g' |
+printf "%08x%08x%08x%64s%64s%08x" $nonce $bits $time $mrkl_root $prev_block $ver |
+tr ' ' '0' |
bigEndianHex2littleEndianHex |
xxd -r -p |
openssl dgst -sha256 -binary |
#{
# "hash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
# "ver":1,
# "prev_block":"0000000000000000000000000000000000000000000000000000000000000000",
# "mrkl_root":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
# "time":1231006505,
# "bits":486604799,
# "nonce":2083236893,
bigEndianHex2littleEndianHex() {
local s=''
while read -n 2 char
do s=$char$s
done
echo $s
}
ver=1
prev_block=0000000000000000000000000000000000000000000000000000000000000000
mrkl_root=4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
time=1231006505
bits=486604799
nonce=2083236893
printf "%08x%08x%08x%064s%064s%08x" $nonce $bits $time $mrkl_root $prev_block $ver |
bigEndianHex2littleEndianHex |
xxd -r -p |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
sed 's/^.* //' |
bigEndianHex2littleEndianHex
xxd -pr
# A=0x41, B=0x42, C=0x43
$ echo 414243 | xxd -r -p && echo
ABC
$
#{
# "hash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
# "ver":1,
# "prev_block":"0000000000000000000000000000000000000000000000000000000000000000",
# "mrkl_root":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
# "time":1231006505,
# "bits":486604799,
# "nonce":2083236893,
ver=1
prev_block=0000000000000000000000000000000000000000000000000000000000000000
mrkl_root=4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
time=1231006505
bits=486604799
nonce=2083236893
for s in - ''
do for a in 2 4
do for b in 64 128
do for c in 16 24 32
do
printf "%$s${a}x%$s${b}s%$s${b}s%$s${c}x%$s${c}x%$s${c}x" $ver $prev_block $mrkl_root $time $bits $nonce |
sed 's/ /0/g' |
xxd -pr |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
sed 's/^.* //'
done
done
done
done