manipulating Digest state

L

leon breedt

Hi,

Perhaps this is not possible, but I was wondering if there was a way
to save/load the state of a Digest. Not the digest value itself but
the state that gives a particular digest value.

Why?

If I am retrieving some data, and update the digest as I receive
bytes, it would be more efficient if I could store the state that
would give me the digest of the data up to a certain point, as I can
avoid rescanning the data when resuming an interrupted retrieval and
just "resume" the digest update as well, especially as the file size
increases.

Is this at all feasible? (Leaving security/integrity concerns aside).

Leon
 
E

Eivind Eklund

Hi,

Perhaps this is not possible, but I was wondering if there was a way
to save/load the state of a Digest. Not the digest value itself but
the state that gives a particular digest value.

Unless the Digest class is "special", you should be able to just data
= Marshal.dump(digest) and restoire with Marshal.load(data).
Is this at all feasible? (Leaving security/integrity concerns aside).

Yes. The security side is also fairly OK (primary new issues:
Synchronized disk writes and access permissions to aborted fil;e and
serialized Digest, and the increased corruption time window.)

Eivind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top