Crypt-MagicSignatures-Key
view release on metacpan or search on metacpan
lib/Crypt/MagicSignatures/Key.pm view on Meta::CPAN
utf8::encode $v if utf8::is_utf8 $v;
$v = encode_base64($v, '');
$v =~ tr{+/\t-\x0d }{-_}d;
# Trim padding or not
$v =~ s/\=+$// unless (defined $_[1] ? $_[1] : 1);
$v;
};
# Returns the b64 urlsafe decoded string
sub b64url_decode {
my $v = shift;
return '' unless $v;
$v =~ tr{-_}{+/};
my $padding;
# Add padding
if ($padding = (length($v) % 4)) {
( run in 0.250 second using v1.01-cache-2.11-cpan-26ccb49234f )