chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] possible bug in simple-sha1


From: Kristian Lein-Mathisen
Subject: [Chicken-hackers] possible bug in simple-sha1
Date: Sun, 2 Jun 2019 12:39:25 +0200


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 address@hidden ~/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 address@hidden ~/archive  ➤ dd bs=1M count=512 if=/dev/zero of=/tmp/bigzero
1234 address@hidden ~/archive  ➤ csi -R simple-sha1 -p '(sha1sum "/tmp/bigzero")' ; sha1sum "/tmp/bigzero"
28ce52a92ea1bbda6c0a6415eae186be7523698a  # <-- bad!
5b088492c9f4778f409b7ae61477dec124c99033  /tmp/bigzero
1234 address@hidden ~/archive  ➤ dd bs=1M count=511 if=/dev/zero of=/tmp/bigzero
1234 address@hidden ~/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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]