Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > manipulating Digest state

Reply
Thread Tools

manipulating Digest state

 
 
leon breedt
Guest
Posts: n/a
 
      11-05-2004
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


 
Reply With Quote
 
 
 
 
Eivind Eklund
Guest
Posts: n/a
 
      11-05-2004
On Fri, 5 Nov 2004 14:16:08 +0900, leon breedt <(E-Mail Removed)> wrote:
> 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.
--
Hazzle free packages for Ruby?
RPA is available from http://www.rubyarchive.org/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't locate Digest/SHA.pm cannot install Digest/SHA myalo Perl Misc 4 11-28-2007 11:10 PM
help: digest/sha2.so: no such file to load -- digest.so Tammy Mc Ruby 3 10-01-2006 01:36 AM
Custom Error Page Using Digest Authentication Wayne Carlaw ASP .Net 0 03-29-2005 07:09 PM
Any way to maintain a digest-authenticated session in .NET? paul@chipsnetwork.com ASP .Net 0 03-26-2005 03:00 AM
Somewhat OT: HTTP Authentication - Digest EJ MCSE 0 10-24-2003 01:33 PM



Advertisments