Venus::Role::Digestable

Digestable Role

Digestable Role for Perl 5

method: digest method: digester method: b64digest method: bindigest method: hexdigest

package Example;

use Venus::Class;

attr 'data';

with 'Venus::Role::Dumpable';
with 'Venus::Role::Digestable';

sub execute {
  my ($self, @args) = @_;

  return [$self->data, @args];
}

package main;

my $example = Example->new(data => 123);

# $example->digest;

# "a6c3d9ae59f31690eddbdd15271e856a6b6f15d5"

This package modifies the consuming package and provides methods for producing message digests from a dump of the object or the return value of a dispatched method call. All algorithms supported by Digest are supported, e.g. SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, HMAC-MD5, HMAC-SHA-1, etc.

The digest method returns a hexadecimal formatted digest of a dump of the object or return value of a dispatched method call. The algorithm defaults to SHA-1. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

digest(Str $algo, Str $method, Any @args) (Str)

{ since => '0.01', }

=example-1 digest

package main;

my $example = Example->new(data => 123);

my $digest = $example->digest;

# "fcf148788471488b822cf72b6d6ca9c17554a4c6"

The digester method returns a Digest object with a dump of the object or return value of a dispatched method call as the message. The algorithm defaults to SHA-1. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

digester(Str $algo, Str $method, Any @args) (Str)

{ since => '0.01', }

=example-1 digester

package main;

my $example = Example->new(data => 123);

my $digester = $example->digester;

# bless(..., "Digest::SHA")

The b64digest method returns a base64 formatted digest of the object or return value of a dispatched method call. The algorithm defaults to SHA-1. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

b64digest(Str $algo, Str $method, Any @args) (Str)

{ since => '0.01', }

=example-1 b64digest

package main;

my $example = Example->new(data => 123);

my $b64digest = $example->b64digest;

# "/PFIeIRxSIuCLPcrbWypwXVUpMY"

The bindigest method returns a binary formatted digest of the object or return value of a dispatched method call. The algorithm defaults to SHA-1. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

bindigest(Str $algo, Str $method, Any @args) (Str)

{ since => '0.01', }

=example-1 bindigest

package main;

my $example = Example->new(data => 123);

my $bindigest = $example->bindigest;

# pack("H*","fcf148788471488b822cf72b6d6ca9c17554a4c6")

The hexdigest method returns a ... formatted digest of the object or return value of a dispatched method call. The algorithm defaults to SHA-1. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

hexdigest(Str $algo, Str $method, Any @args) (Str)

{ since => '0.01', }

=example-1 hexdigest

package main;

my $example = Example->new(data => 123);

my $hexdigest = $example->hexdigest;

# "fcf148788471488b822cf72b6d6ca9c17554a4c6"

t/Venus.t: pdml: authors t/Venus.t: pdml: license

31 POD Errors

The following errors were encountered while parsing the POD:

Around line 13:

Unknown directive: =name

Around line 21:

Unknown directive: =tagline

Around line 29:

Unknown directive: =abstract

Around line 37:

Unknown directive: =includes

Around line 49:

Unknown directive: =synopsis

Around line 85:

Unknown directive: =description

Around line 97:

Unknown directive: =method

Around line 104:

Unknown directive: =signature

Around line 108:

Unknown directive: =metadata

Around line 144:

=cut found outside a pod block. Skipping to next block.

Around line 164:

=cut found outside a pod block. Skipping to next block.

Around line 174:

Unknown directive: =method

Around line 181:

Unknown directive: =signature

Around line 185:

Unknown directive: =metadata

Around line 221:

=cut found outside a pod block. Skipping to next block.

Around line 231:

Unknown directive: =method

Around line 238:

Unknown directive: =signature

Around line 242:

Unknown directive: =metadata

Around line 278:

=cut found outside a pod block. Skipping to next block.

Around line 298:

=cut found outside a pod block. Skipping to next block.

Around line 308:

Unknown directive: =method

Around line 315:

Unknown directive: =signature

Around line 319:

Unknown directive: =metadata

Around line 355:

=cut found outside a pod block. Skipping to next block.

Around line 375:

=cut found outside a pod block. Skipping to next block.

Around line 385:

Unknown directive: =method

Around line 392:

Unknown directive: =signature

Around line 396:

Unknown directive: =metadata

Around line 432:

=cut found outside a pod block. Skipping to next block.

Around line 452:

=cut found outside a pod block. Skipping to next block.

Around line 462:

Unknown directive: =partials