[Botan-devel] Hashing a file 1KB at a time

Z. S. O. tiredashell at gmail.com
Fri Mar 6 23:59:37 EST 2009


I'd like to make a function that hashes a file of any length and returns the
result as a string. The tutorial recommends using DataSink_Stream, but I
don't want to write anything to the disk. I would just like it to hash 1
kilobyte at a time, updating the hash each time.
Normally, I would do something like this:

while ( (len = fread (buffer, 1, 1024, file)) ) {
//update hash with buffer here
}

How would I go about achieving this in Botan?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20090306/ecdf878c/attachment.html>


More information about the botan-devel mailing list