I am able to generate SHA-1 hash for a whole file. I did this using Open SSL through the following C++ code.
file_buffer = mmap(0, file_size, PROT_READ, MAP_SHARED, file_name, 0);
SHA1((unsigned char*) file_buffer, file_size, hash_value);
But I want to create separate hash values for smaller chunks of the file.
Consider,
File Size = 10KB and
Chunk Size = 2KB
In this case, I want to generate 5 hash values for each chunk of the file. How can I do this?
1 Answer