Bump version numbers for release
[gitmo/MooseX-Storage.git] / lib / MooseX / Storage / Base / WithChecksum.pm
index fb40bcf..d7a888d 100644 (file)
@@ -7,7 +7,8 @@ use Data::Dumper ();
 
 use MooseX::Storage::Engine;
 
-our $VERSION = '0.01';
+our $VERSION   = '0.18';
+our $AUTHORITY = 'cpan:STEVAN';
 
 our $DIGEST_MARKER = '__DIGEST__';
 
@@ -48,7 +49,18 @@ sub _digest_packed {
     {
         local $Data::Dumper::Indent   = 0;
         local $Data::Dumper::Sortkeys = 1;
-        $d->add( Data::Dumper::Dumper($collapsed) );
+        local $Data::Dumper::Terse    = 1;
+        local $Data::Dumper::Useqq    = 0;
+        local $Data::Dumper::Deparse  = 0; # FIXME?
+        my $str = Data::Dumper::Dumper($collapsed);
+        # NOTE:
+        # Canonicalize numbers to strings even if it 
+        # mangles numbers inside strings. It really 
+        # does not matter since its just the checksum
+        # anyway.
+        # - YK/SL
+        $str =~ s/(?<! ['"] ) \b (\d+) \b (?! ['"] )/'$1'/gx; 
+        $d->add( $str );
     }
 
     return $d->hexdigest;
@@ -88,12 +100,17 @@ __END__
 
 =head1 NAME
 
-MooseX::Storage::Base::WithChecksum
-
-=head1 SYNOPSIS
+MooseX::Storage::Base::WithChecksum - A more secure serialization role
 
 =head1 DESCRIPTION
 
+This is an early implementation of a more secure Storage role, 
+which does integrity checks on the data. It is still being 
+developed so I recommend using it with caution. 
+
+Any thoughts, ideas or suggestions on improving our technique 
+are very welcome.
+
 =head1 METHODS
 
 =over 4
@@ -126,7 +143,7 @@ Yuval Kogman
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>