tjko / jpeginfo

jpeginfo - prints information and tests integrity of JPEG/JFIF files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
139 stars 17 forks source link

md5 and sha*: Use stdint.h for uint32_t and uint64_t #28

Closed schwehr closed 10 months ago

schwehr commented 10 months ago

Made a quick test by hand:

Before:

for option in md5 sha256 sha512; do ./jpeginfo cover.jpg --$option ; done
cover.jpg                         147 x  147 24bit N JFIF                       20189 b8832777d98fea16a0ff35b06d212536        
cover.jpg                         147 x  147 24bit N JFIF                       20189 dfd70d65eb33dea306da1a307fb9f72630a21250bf728b41529762b12d0295e7        
cover.jpg                         147 x  147 24bit N JFIF                       20189 5b0bfbfe19403fa97eae08405284ece150db098f713151f0741e16a9c5dc4df7425eca8a926781911aaee08da6b0156824ec2e55391da512d40938f5fed5b6bb        

With the change:

for option in md5 sha256 sha512; do ./jpeginfo cover.jpg --$option ; done
cover.jpg                         147 x  147 24bit N JFIF                       20189 b8832777d98fea16a0ff35b06d212536        
cover.jpg                         147 x  147 24bit N JFIF                       20189 dfd70d65eb33dea306da1a307fb9f72630a21250bf728b41529762b12d0295e7        
cover.jpg                         147 x  147 24bit N JFIF                       20189 5b0bfbfe19403fa97eae08405284ece150db098f713151f0741e16a9c5dc4df7425eca8a926781911aaee08da6b0156824ec2e55391da512d40938f5fed5b6bb  

stdint.h is required as of C99.

See also: