Skip to content

Commit

Permalink
change hashing method to md5sum
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuoxuan-Zhang committed Oct 29, 2024
1 parent ef03f8b commit 1ed0a79
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion web-index/hashes/1-grams.txt.small.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d6b8e768732a1cdbd988cd9746ec55e10879fc68c938f65322c5444d63884305
b7006f6d425233137811f16eeb6ca668
2 changes: 1 addition & 1 deletion web-index/hashes/2-grams.txt.small.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
02d05ddd5933129ff92fa4855bde43284df8150d9c010183f19d42ee9d33dd9d
a48e86700b02c50651e8d4b09a73170c
2 changes: 1 addition & 1 deletion web-index/hashes/3-grams.txt.small.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
509c3930f7aa56c8b5dfd431d5dd8f202d7fb0f1ef668524122e3a9920affd19
73310ad60a0d2d50d805901c481a5dbc
8 changes: 4 additions & 4 deletions web-index/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if [[ "$@" == *"--small"* ]]; then
fi

if [[ "$@" == *"--generate"* ]]; then
# generate hashes and store in hashses directory for all *grams.txt files
# generate hashes and store in hashes directory for all *grams.txt files
for file in $(find ${eval_dir} -name "*grams.txt"); do
echo "Generating hash for ${file}"
hash=$(sha256sum ${file} | cut -d ' ' -f 1)
hash=$(md5sum ${file} | cut -d ' ' -f 1)
echo "Hash: ${hash}"
echo "${hash}" > "${hashes_dir}/$(basename ${file})${suffix}.hash"
done
Expand All @@ -26,7 +26,7 @@ fi

# verify hashes for all *grams.txt files
for file in $(find ${eval_dir} -name "*grams.txt"); do
hash=$(sha256sum ${file} | cut -d ' ' -f 1)
hash=$(md5sum ${file} | cut -d ' ' -f 1)
expected_hash=$(cat "${hashes_dir}/$(basename ${file})${suffix}.hash")
if [[ "${hash}" != "${expected_hash}" ]]; then
echo "Hash mismatch for ${file}"
Expand All @@ -35,4 +35,4 @@ for file in $(find ${eval_dir} -name "*grams.txt"); do
exit 1
fi
done
echo $?
echo $?

0 comments on commit 1ed0a79

Please sign in to comment.