-
-
20 Feb 2022 04:16:45 UTC
- Distribution: Sereal
- Module version: 4.023
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (535 / 0 / 0)
- Kwalitee
Bus factor: 1- 96.49% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity
24 month- Tools
- Download (192.58KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Sereal::Decoder
- Sereal::Encoder
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- SYNOPSIS
- DESCRIPTION
- BUGS, CONTACT AND SUPPORT
- AUTHOR
- ACKNOWLEDGMENT
- LICENSE
- COPYRIGHT AND LICENSE
NAME
Sereal - Fast, compact, powerful binary (de-)serialization
SYNOPSIS
use Sereal qw( get_sereal_decoder get_sereal_encoder clear_sereal_object_cache encode_sereal decode_sereal read_sereal read_sereal_file write_sereal write_sereal_file looks_like_sereal scalar_looks_like_sereal sereal_encode_with_object sereal_decode_with_object decode_sereal_with_header_data sereal_decode_with_header_with_object sereal_decode_only_header_with_object sereal_decode_only_header_with_offset_with_object sereal_decode_with_header_and_offset_with_object sereal_decode_with_offset_with_object SRL_UNCOMPRESSED SRL_SNAPPY SRL_ZLIB SRL_ZSTD ); # Note: For performance reasons, you should prefer the OO interface, # or sereal_(en|de)code_with_object over the stateless # encode_sereal/decode_sereal functions. # See the Sereal::Performance documentation for details.
DESCRIPTION
Sereal is an efficient, compact-output, binary and feature-rich serialization protocol. The Perl encoder is implemented as the Sereal::Encoder module, the Perl decoder correspondingly as Sereal::Decoder. They are distributed separately to allow for safe upgrading without downtime. (Hint: Upgrade the decoder everywhere first, then the encoder.)
This
Sereal
module is a very thin wrapper around bothSereal::Encoder
andSereal::Decoder
. It depends on both and loads both. So if you have a user of both encoder and decoder, it is enough to depend on a particular version ofSereal
and you'll get the most recent released versions ofSereal::Encoder
andSereal::Decoder
whose version is smaller than or equal to the version ofSereal
you depend on.The protocol specification and many other bits of documentation can be found in the github repository. Right now, the specification is at https://github.com/Sereal/Sereal/blob/master/sereal_spec.pod, there is a discussion of the design objectives in https://github.com/Sereal/Sereal/blob/master/README.pod, and the output of our benchmarks can be seen at https://github.com/Sereal/Sereal/wiki/Sereal-Comparison-Graphs.
EXPORTED FUNCTIONS
It is recommended to use the object-oriented interface of
Sereal::Encoder
andSereal::Decoder
if you care about performance. For detailed performance considerations, see Sereal::Performance.You can optionally import five functions from
Sereal
.encode_sereal
is the same function as Sereal::Encoder'sencode_sereal
function.decode_sereal
andlooks_like_sereal
are the same as Sereal::Decoder's functions of the same names. Finally, you can import the advanced functional interfacesereal_encode_with_object
andsereal_decode_with_object
. Again, see Sereal::Performance for information about those.After loading the
Sereal
module, bothSereal::Encoder
andSereal::Decoder
are guaranteed to be loaded, so you can use their object-oriented interface.get_sereal_encoder($OPTSHASH)
Returns a Sereal::Encoder with the given options. This encoder will be shared by other calls to this function.
get_sereal_decoder($OPTSHASH)
Returns a Sereal::Decoder with the given options. This encoder will be shared by other calls to this function.
clear_sereal_object_cache
Clears cache of objects created via get_sereal_encoder() and get_sereal_decoder(). Returns the number of objects that were removed from the cache (the sum of both types).
write_sereal_file($FILENAME,$STRUCT,$APPEND,$OPTS)
Write a sereal packet to $FILENAME. See Sereal::Encoder::encode_to_file().
write_sereal($FILENAME,$STRUCT,$APPEND,$OPTS)
alias for write_sereal_file()
read_sereal_file($FILENAME,$OPTS,$ROOT)
Read a sereal packet from a file. See Sereal::Decoder::decode_from_file().
read_sereal($FILENAME,$OPTS,$ROOT)
alias for read_sereal_file()
BUGS, CONTACT AND SUPPORT
For reporting bugs, please use the github bug tracker at http://github.com/Sereal/Sereal/issues.
For support and discussion of Sereal, there are two Google Groups:
Announcements around Sereal (extremely low volume): https://groups.google.com/forum/?fromgroups#!forum/sereal-announce
Sereal development list: https://groups.google.com/forum/?fromgroups#!forum/sereal-dev
AUTHOR
Steffen Mueller <smueller@cpan.org>
ACKNOWLEDGMENT
This module was originally developed for Booking.com. With approval from Booking.com, this module was generalized and published on CPAN, for which the authors would like to express their gratitude.
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
COPYRIGHT AND LICENSE
Copyright (C) 2012, 2013, 2014 by Steffen Mueller
Module Install Instructions
To install Sereal, copy and paste the appropriate command in to your terminal.
cpanm Sereal
perl -MCPAN -e shell install Sereal
For more information on module installation, please visit the detailed CPAN module installation guide.