X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDigest.pm;h=8ebf61a487036a8c607eab4c76d33abd767d0920;hb=3b0db4f96671dacfd3421850abb588b84e2ce6da;hp=047380ebeb3103a06ac072aa079557efded42d49;hpb=3357b1b1dc05eb65c7266f1983048cb27893b96c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Digest.pm b/lib/Digest.pm index 047380e..8ebf61a 100644 --- a/lib/Digest.pm +++ b/lib/Digest.pm @@ -3,7 +3,7 @@ package Digest; use strict; use vars qw($VERSION %MMAP $AUTOLOAD); -$VERSION = "1.00"; +$VERSION = "1.02"; %MMAP = ( "SHA-1" => "Digest::SHA1", @@ -124,11 +124,16 @@ load the right module on first use. The second form allow you to use algorithm names which contains letters which are not legal perl identifiers, e.g. "SHA-1". -If new() is called as a instance method (i.e. $ctx->new) it will just +If new() is called as an instance method (i.e. $ctx->new) it will just reset the state the object to the state of a newly created object. No new object is created in this case, and the return value is the reference to the object (i.e. $ctx). +=item $other_ctx = $ctx->clone + +The clone method creates a copy of the digest state object and returns +a reference to the copy. + =item $ctx->reset This is just an alias for $ctx->new. @@ -151,7 +156,8 @@ Return the binary digest for the message. Note that the C operation is effectively a destructive, read-once operation. Once it has been performed, the $ctx object is automatically C and can be used to calculate another digest -value. +value. Call $ctx->clone->digest if you want to calculate the digest +without reseting the digest state. =item $ctx->hexdigest