Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to store SHA512 checksum of the file for my application. How to do it in common (popular) way? So this checksum can be used but by third party application too.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Write the checksum as lowercase hex digits followed by two spaces and then the filename, with one file per line. This is the format used by md5sum and the various sha*sum CLI tools.

$ sha512sum t.txt
d663b43c84ab4ba20040e568d3cb799512fcc00f1053f96f3079345f680b39429adc92f9c8c45fc9ae6053173ddc5b35ade25ae1d5c91e57b809d0c021d5c891  t.txt

$ sha512sum -c <(sha512sum t.txt)
t.txt: OK
share|improve this answer
    
Does it support paths instead of filenames? –  ShyBoy Oct 21 '11 at 7:44
    
It does, both relative and absolute. –  Ignacio Vazquez-Abrams Oct 21 '11 at 10:45

All schecksum files I've seen were just plain ASCII files which contained the checksum only. This way they may be easily compared with checksum command outputs.

Good practice is to indicate the checksum algorithm used with a filename suffix, eg .md5 or .crc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.