Data-Serializer

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

		'Digest::SHA' => 0,
		'Data::Dumper' => 2.08,
	},
	build_requires => {
		#'AutoSplit'	=> 0,
		'IO::File' => 0,
		'Test::More' => 0,
		'File::Spec' => 0,
	},
	recommends => { 
		'Crypt::CBC'		=> 0,
		'Crypt::Blowfish'	=> 0,
                'Data::Denter'		=> 0,
                'Data::Taxi'		=> 0,
                'Storable'		=> 0,
                'FreezeThaw'		=> 0,
                'Config::General'	=> 0,
                'YAML'			=> 0,
                'YAML::Syck'		=> 0,
                'PHP::Serialization'	=> 0,
                'JSON'			=> 0,

Changes  view on Meta::CPAN

		patch supplied by Dulaunoy Fabrice <fabrice@dulaunoy.com>

0.46  Wed Apr  23 2008
	- Fixed Module::Build implementation, will now generate proper META.yml file

0.45  Wed Apr  23 2008
	- Removed support for Tie::Transient, the module is long gone.  If ever a standard
	  emerges for tagging data as transient then Data::Serializer will support it.  
	- Added utf8 call to Data::Serializer::JSON 
		patch supplied by Makamaka <makamaka@donzoko.net> in response to complex bug discussion 
		that started under Crypt::CBC http://rt.cpan.org/Public/Bug/Display.html?id=35239 

0.44  Thu Dec  13 2008
	- Added 'raw' flag to constructor, allows for more convenient
	  raw access to underlying serializers
	- retrieve altered to read in full contents of file specified, this change could be disruptive
	  if you were using retrieve in a non-standard way, so be aware of it.
	- store and retrieve when the raw flag is set will do what you would expect
          and store and retrieve serialized data from files in their raw underlying
          serializer format with no Data::Serializer markup included
	- Removed last usage of Autoloader (decided it isn't worth the irritation of keeping it)

Changes  view on Meta::CPAN

 	- Added method 'options' for passing arguments to underlying serializers
	  currently only supported for Config::General
	- Converted installation tests to use ExtUtils::Tbone (included)
	- Added more robust testing of all serializers and features
		Thanks to Thomas Linden <tom@daemon.de> who wrote a patch
	          adding support for Config::General to Data::Serializer
                  and for suggesting the addition of the options method

0.15  Mon Jul  1 13:32:46 MDT 2002
	- Correct Makefile.PL testing bug
          In particular we tested for Crypt::CBC and assumed Crypt::Blowfish
          would also be installed.  This is obviously not the case.  We do not 
          want to force this as a dependency as encryption is a feature, not a 
          requirement for serializing data structures.
	    Thanks to 'Automated Perl Test Account <perl_test@logicalchaos.org>'
  
           
0.14  Mon Jul  1 08:43:42 MDT 2002
	- Corrected typo's in pod documentation
          Thanks to Florian Helmberger <f.helmberger@uptime.at>

META.yml  view on Meta::CPAN

  Exporter: 0
  IO::File: 0
recommends:
  Bencode: 0
  Compress::PPMd: 0
  Compress::Zlib: 0
  Config::General: 0
  Convert::Bencode: 0
  Convert::Bencode_XS: 0
  Crypt::Blowfish: 0
  Crypt::CBC: 0
  Data::Denter: 0
  Data::Taxi: 0
  FreezeThaw: 0
  JSON: 0
  JSON::Syck: 0
  JSON::XS: 0
  MIME::Base64: 0
  PHP::Serialization: 0
  Storable: 0
  XML::Dumper: 0

README  view on Meta::CPAN

        YAML::Syck(3)

        Default is to use Data::Dumper.

        Each serializer has its own caveat's about usage especially when
        dealing with cyclical data structures or CODE references. Please see
        the appropriate documentation in those modules for further
        information.

    cipher - change the cipher method
        Utilizes Crypt::CBC(3) and can support any cipher method that it
        supports.

    digester - change digesting method
        Uses Digest(3) so can support any digesting method that it supports.
        Digesting function is used internally by the encryption routine as
        part of data verification.

    compressor - changes compresing module
        Currently Compress::Zlib(3) and Compress::PPMd(3) are the only
        options

README  view on Meta::CPAN

    PHP::Serialization(3)
    Storable(3)
    XML::Dumper(3)
    XML::Simple(3)
    YAML(3)
    YAML::Syck(3)
    Compress::Zlib(3)
    Compress::PPMd(3)
    Digest(3)
    Digest::SHA(3)
    Crypt::CBC(3)
    MIME::Base64(3)
    IO::File(3)
    Data::Serializer::Config::Wrest(3) - adds supports for Config::Wrest(3)

examples/README  view on Meta::CPAN

      $serializer->secret('mysecret');

      my $encrypted_hashref = $serializer->serializer($hash);

      ... (in other program) ...

      $serializer->secret('mysecret');

      my $clear_hash = $serializer->deserializer($encrypted_hash);

    Note: You will have to have the Crypt::CBC module installed for this to
    work.

Compressing your data
    You wish to compress your data structure to cut down on how much disk
    space it will take up.

  Solution
      $serializer->compress(1);

      my $compressed_hashref = $serializer->serializer($hash);

lib/Data/Serializer.pm  view on Meta::CPAN

  $serializer_obj->deserialize($input);
}

sub _encrypt {
  my $self = (shift);
  my $value = (shift);
  my $cipher = (shift);
  my $digester = (shift);
  my $secret = $self->secret;
  croak "Cannot encrypt: No secret provided!" unless defined $secret;
  $self->_module_loader('Crypt::CBC');	
  my $digest = $self->_endigest($value,$digester);
  my $cipher_obj = Crypt::CBC->new($secret,$cipher);
  return $cipher_obj->encrypt($digest);
}
sub _decrypt {
  my $self = (shift);
  my $input = (shift);
  my $cipher = (shift);
  my $digester = (shift);
  my $secret = $self->secret;
  croak "Cannot encrypt: No secret provided!" unless defined $secret;
  $self->_module_loader('Crypt::CBC');	
  my $cipher_obj = Crypt::CBC->new($secret,$cipher);
  my $digest = $cipher_obj->decrypt($input);
  return $self->_dedigest($digest,$digester);
}
sub _endigest {
  my $self = (shift);
  my $input = (shift);
  my $digester = (shift);
  $self->_module_loader('Digest');	
  my $digest = $self->_get_digest($input,$digester);
  return "$digest=$input";

lib/Data/Serializer.pm  view on Meta::CPAN

Default is to use Data::Dumper.



Each serializer has its own caveat's about usage especially when dealing with
cyclical data structures or CODE references.  Please see the appropriate
documentation in those modules for further information.

=item B<cipher> - change the cipher method

Utilizes L<Crypt::CBC(3)> and can support any cipher method that it supports.

=item B<digester> - change digesting method

Uses L<Digest(3)> so can support any digesting method that it supports.  Digesting
function is used internally by the encryption routine as part of data verification.

=item B<compressor> - changes compresing module

Currently L<Compress::Zlib(3)> and L<Compress::PPMd(3)> are the only options

lib/Data/Serializer.pm  view on Meta::CPAN

=item L<YAML::Syck(3)>

=item L<Compress::Zlib(3)>

=item L<Compress::PPMd(3)>

=item L<Digest(3)>

=item L<Digest::SHA(3)>

=item L<Crypt::CBC(3)>

=item L<MIME::Base64(3)>

=item L<IO::File(3)>

=item L<Data::Serializer::Config::Wrest(3)> - adds supports for L<Config::Wrest(3)>

=back

=cut

lib/Data/Serializer/Cookbook.pm  view on Meta::CPAN

  $serializer->secret('mysecret');

  my $encrypted_hashref = $serializer->serializer($hash);

  ... (in other program) ...

  $serializer->secret('mysecret');

  my $clear_hash = $serializer->deserializer($encrypted_hash);

Note:  You will have to have the Crypt::CBC module installed for
this to work.  

=head1 Compressing your data 

You wish to compress your data structure to cut down on how much
disk space it will take up.

=head2 Solution

  $serializer->compress(1);

t/serializer-testlib  view on Meta::CPAN

                  );

%features = (
                'objraw'     	 => [],
                'raw'     	 => [],
                'rawnew'     	 => [],
                'non-portable'   => [],
                'basic'     	 => [],
                'cgopt'     	 => [],
                'xmldumpopt'   	 => [],
                'encryption'     => [qw (Crypt::CBC Crypt::Blowfish)],
                'compresszlib'    => [qw (Compress::Zlib)],
                'compressppmd'    => [qw (Compress::PPMd)],
                'encoding'       => [qw (MIME::Base64)],
                'md5'       => [qw (Crypt::CBC Crypt::Blowfish Digest::MD5)],
                'sha1'     	 => [qw (Crypt::CBC Crypt::Blowfish Digest::SHA1)],
                'sha-256'     	 => [qw (Crypt::CBC Crypt::Blowfish Digest::SHA)],
                );


sub run_test {
        my ($T,$serializer,$test,$features) = @_;
        $T->msg("Test $serializer $test $features");  # message for the log
	my $obj;
        my @features = (split(" ", $features));
        if (grep {/^objraw$/} @features) {
        	$obj = Data::Serializer::Raw->new(serializer=>$serializer);



( run in 0.912 second using v1.01-cache-2.11-cpan-e1769b4cff6 )