mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-18 04:10:57 +01:00
initial commit
This commit is contained in:
32
tests/check-collisions.sh
Executable file
32
tests/check-collisions.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
rounds=$1
|
||||
|
||||
if test -z "$rounds"; then
|
||||
rounds=10
|
||||
fi
|
||||
|
||||
make check
|
||||
|
||||
log="collisions.log"
|
||||
name=""
|
||||
echo "Checking collisions for hash algorithms with ${rounds} rounds:" > $log
|
||||
|
||||
for hash in c o f d s; do
|
||||
case $hash in
|
||||
o) name="OAT";;
|
||||
c) name="CRC";;
|
||||
s) name="SAX";;
|
||||
d) name="DJB";;
|
||||
f) name="FNV";;
|
||||
esac
|
||||
echo -n "Running ${rounds} x ${name} hash ... "
|
||||
echo -n "Collisions for ${name}: " >> $log
|
||||
./col -l ${rounds} -${hash} \
|
||||
| sort | uniq -c | sort | grep -v "1 " | wc -l \
|
||||
>> $log
|
||||
echo "done."
|
||||
done
|
||||
|
||||
echo
|
||||
echo "Review $log for the results."
|
||||
Reference in New Issue
Block a user