tipr/bagit

Can't validate upper-case checksums

awead opened this issue · 1 comments

awead commented

I have this checksum in the my manifest file:

464189699A46660FD5FC2B5BF91002546C939CE6 data/rest/dev/32/ce/1a/60/32ce1a60-6676-4e4a-b8c2-406e616b4a00.ttl

When running .valid? on the bag, I'm getting this error:

"expected data/rest/dev/32/ce/1a/60/32ce1a60-6676-4e4a-b8c2-406e616b4a00.ttl to have Digest::SHA1: 464189699A46660FD5FC2B5BF91002546C939CE6, actual is 464189699a46660fd5fc2b5bf91002546c939ce6"

My solution for this was to just use Ruby's string .downcase method on the checksum string when doing the comparison. That will cover uppercase or even mixed-case checksums.