Aut::Base64 - Base64 encoding/decoding for Aut.


Aut documentation Contained in the Aut distribution.

Index


Code Index:

NAME

Top

Aut::Base64 -- Base64 encoding/decoding for Aut.

ABSTRACT

Top

This module encapsulates MIME::Base64. It sees to it that encoded strings that terminate with a newline ('\n') are chomped. This has been done to facilitate Aut Backends that loose trailing newlines (like Config::Inifiles).

If trailing newlines (whitespace) is lost, hashing algorithms start to behave different for strings that appear the same.

DESCRIPTION

Top

new() --> Aut::Base64

Instantiates a new Aut::Base64 object.

encode(text) --> base64 string

Encodes text into a base64 string using MIME::Base64's encode_base64() function and chomps it.

decode(base64 string)) --> string

Decodes base64 text using MIME::Base64's decode_base64().

AUTHOR

Top

Hans Oesterholt-Dijkema <oesterhol@cpan.org>

COPYRIGHT AND LICENSE

Top


Aut documentation Contained in the Aut distribution.

package Aut::Base64;

# $Id: Base64.pm,v 1.2 2004/04/08 16:55:13 cvs Exp $

use strict;
use MIME::Base64;

sub new {
  my $class=shift;
  my $self;

  $self->{"base64"}=1;
  bless $self,$class;

return $self;
}

sub encode {
  my $self=shift;
  my $text=shift;
  $text=encode_base64($text);
  chomp $text;
return $text;
}

sub decode {
  my $self=shift;
  my $text=shift;
return decode_base64($text);
}

1;
__END__