Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avuserow/perl6-compress-snappy
Perl6 bindings to (de)compress data in Google's Snappy compression format
https://github.com/avuserow/perl6-compress-snappy
Last synced: 2 months ago
JSON representation
Perl6 bindings to (de)compress data in Google's Snappy compression format
- Host: GitHub
- URL: https://github.com/avuserow/perl6-compress-snappy
- Owner: avuserow
- License: mit
- Created: 2014-04-22T05:46:39.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-06-29T01:00:01.000Z (over 2 years ago)
- Last Synced: 2023-03-10T22:03:08.885Z (almost 2 years ago)
- Language: Raku
- Size: 24.4 KB
- Stars: 5
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# NAME
Compress::Snappy - (de)compress data in Google's Snappy compression format
# INSTALLATION
`libsnappy-dev` or equivalent needs to be installed for this to
work. Issuesudo apt-get install libsnappy-dev
or equivalent order in other operatins systems or distros to do so.# SYNOPSIS
```perl6
my Buf $compressed = Compress::Snappy::compress("hello, world");
my Bool $valid = Compress::Snappy::validate($compressed);
my Buf $decompressed = Compress::Snappy::decompress($compressed);
```See also examples/test.p6
# DESCRIPTION
This module uses NativeCall to provide bindings to the C API for libsnappy, a
compression library with an emphasis on speed over compression.# FUNCTIONS
## Compress::Snappy::compress(Blob $uncompressed) returns Buf
Main compression function. Returns a Buf of compressed data.
## Compress::Snappy::compress(Str $uncompressed, Str $encoding = 'utf-8') returns Buf
Convenience function to make a Str to an encoded Blob and compress that.
Encoding defaults to utf-8 if not specified.## Compress::Snappy::decompress(Blob $compressed, Str $encoding)
Decompress provided data to a Buf. If an optional $encoding is
specified, will decode the Buf and return a Str instead.## Compress::Snappy::validate(Blob $compressed) returns Bool
Returns if the compressed data is valid, without fully decompressing it.
# SEE ALSO
[Snappy on Google Code](https://code.google.com/p/snappy/)
[Snappy on GitHub](https://github.com/google/snappy)