mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-16 19:40:57 +01:00
32 lines
579 B
Bash
Executable File
32 lines
579 B
Bash
Executable File
#!/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." |