MIME::Base64 - Encoding and decoding Base64 ASCII strings
use MIME::Base64;
my $encoded = MIME::Base64.encode-str("xyzzy‽", :eol("\x0D\x0A"));
my $decoded = MIME::Base64.decode-str($encoded);
or
use MIME::Base64;
my $encoded = MIME::Base64.encode($blob, );
my $decoded-buf = MIME::Base64.decode($encoded);
Implements encoding and decoding to and from base64.
Encodeѕ binary data $data
in base64 format.
By default, the output is wrapped every 76 characters. If :$oneline
is set, wrapping will be disabled. Also optionally takes a :eol
named argument to indicate the type of line-ending to be used. Defaults to "\n"
.
Decodes base64 encoded data into a binary buffer.
Encodes $string
into base64, assuming utf8 encoding. By default, the output is wrapped every 76 characters. If :$oneline
is set, wrapping will be disabled. Also optionally takes a :eol
named argument to indicate the type of line-ending to be used. Defaults to "\n"
.
Decodes $encoded
into a string, assuming utf8 encoding.
Same as .encode-str($string
.
Calls .decode-str($encoded)
Originally written by Adrian White. Maintained by many other people over the years. Now being maintained as a Raku community module.
Copyright 2010 - 2011 Adrian White
Copyright 2012 - 2022 Raku Community
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.