SPVM::MIME::Base64 - Encoding and decoding of base64 strings
use MIME::Base64; my $encoded = MIME::Base64->encode_base64('Aladdin:open sesame'); my $decoded = MIME::Base64->decode_base64($encoded);
MIME::Base64 is a SPVM module.
MIME::Base64
This is a porting of MIME::Base64 to SPVM.
This module provides functions to encode and decode strings into and from the base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions).
The list of class methods.
static method encode_base64_opt : string ($str : string, $eol : string)
Encode data by calling the encode_base64() function. The first argument is the byte string to encode. The second argument is the line-ending sequence to use. It is optional(undef can be specified) and defaults to "\n". The returned encoded string is broken into lines of no more than 76 characters each and it will end with $eol unless it is empty. Pass an empty string as second argument if you do not want the encoded string to be broken into lines.
undef
static method encode_base64 : string ($str : string)
Alias for the following code using "encode_base64_opt".
&encode_base64_opt($str, undef);
static method decode_base64 : string ($str : string)
Decode a base64 string by calling the decode_base64() function. This function takes a single argument which is the string to decode and returns the decoded data.
Any character not part of the 65-character base64 subset is silently ignored. Characters occurring after a '=' padding character are never decoded.
static method encoded_base64_length_opt : int ($str : string, $eol : string)
Returns the length that the encoded string would have without actually encoding it. This will return the same value as length(&encode_base64_opt($bytes, $eol)), but should be more efficient.
length(&encode_base64_opt($bytes, $eol))
static method encoded_base64_length : int ($str : string)
Alias for the following code using "encoded_base64_length_opt".
&encoded_base64_length_opt($str, undef);
static method decoded_base64_length : int ($str : string)
Returns the length that the decoded string would have without actually decoding it. This will return the same value as length(&decode_base64($str)), but should be more efficient.
length(&decode_base64($str))
https://github.com/yuki-kimoto/SPVM-MIME-Base64
Yuki Kimoto (kimoto.yuki@gmail.com)
Copyright 2022-2022 Yuki Kimoto, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SPVM::MIME::QuotedPrint
To install SPVM::MIME::Base64, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM::MIME::Base64
CPAN shell
perl -MCPAN -e shell install SPVM::MIME::Base64
For more information on module installation, please visit the detailed CPAN module installation guide.