How to generate partial checksum of a file

hash, linux, md5

Solution

`head -c 1024 | md5sum`

should work.

Full example, as requested in comments:

`head -c 1024 your_file | md5sum`

Problem

How can i calculate, let's say md5 sum of first 1024 bytes of a file? I tried `od -N 1024 | md5sum` however od output is in octal format by default and this generates different md5 hash.

Original source