User:AnomieBOT/source/AnomieBOT/API/Cache/Encrypted.pm/doc

NAME
AnomieBOT::API::Cache::Encrypted - AnomieBOT API cache helper for encrypted data

SYNOPSIS
use AnomieBOT::API::Cache; my $cache = AnomieBOT::API::Cache->create( $class, $optionString ); $cache->set( 'foo', 'bar' ); say $cache->get( 'foo' ); # Outputs "bar"

DESCRIPTION
adds some utility functions to AnomieBOT::API::Cache for encrypting the data before storing it.

METHODS
In addition to the methods inherited from the base class, the following are available.


 * AnomieBOT&#58;&#58;API&#58;&#58;Cache&#58;&#58;Encrypted->new( $optionString )
 * Creates a new AnomieBOT::API::Cache::Encrypted object, which should be reblessed as a subclass. The option string is a semicolon-separated list of key-value pairs; if the value must contain a semicolon or backslash, escape it using a backslash.
 * Recognized keys are:
 * encrypt
 * Key to be used when encrypting the data.


 * $cache->encode_data( $key, $value )
 * Encodes a Perl data value into binary.  may be a scalar or anything accepted by [#MEMORY-STORE Storable::freeze].
 * Returns the binary data and flags on success, or undef on error.


 * $cache->decode_data( $key, $data, $flags )
 * Decodes binary data into a Perl value, the opposite of.
 * Returns the Perl value on success, or undef on error.

COPYRIGHT
Copyright 2013 Anomie

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.