Hi guys,

I've come across a strange problem with simple-sha1. Sometimes it reports
the wrong hash for large files when I use the sha1sum procedure. I don't
know if the problem is there for strings.

1216 klm@kth ~/archive  ➤ csi -R simple-sha1 -p '(sha1sum "MOV_0384.mp4")'
; sha1sum "MOV_0384.mp4"
cb491b2f692dc3e9269a633f54eceb85269b0442
3b673158654ddc9bb668b5eafc050c8be66ad968
 ./xz2/dcim/phone/100ANDRO/MOV_0384.mp4

>From not-very-rigorous testing, it seems it happens on all files that are
bigger than the 512M mark:

1234 klm@kth ~/archive  ➤ dd bs=1M count=*512* if=/dev/zero of=/tmp/bigzero
1234 klm@kth ~/archive  ➤ csi -R simple-sha1 -p '(sha1sum "/tmp/bigzero")'
; sha1sum "/tmp/bigzero"
28ce52a92ea1bbda6c0a6415eae186be7523698a  # <-- bad!
5b088492c9f4778f409b7ae61477dec124c99033  /tmp/bigzero
1234 klm@kth ~/archive  ➤ dd bs=1M count=*511* if=/dev/zero of=/tmp/bigzero
1234 klm@kth ~/archive  ➤ csi -R simple-sha1 -p '(sha1sum "/tmp/bigzero")'
; sha1sum "/tmp/bigzero"
ad4ea886fa65df3ae5ee0285bf8fde502d9014c5  # <-- good
ad4ea886fa65df3ae5ee0285bf8fde502d9014c5  /tmp/bigzero

I am hoping someone can look into this.
Thanks,
K.
_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to