GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MIME::BASE64::URLSAFE (3)

.ds Aq ’

NAME

MIME::Base64::URLSafe - Perl version of Python’s URL-safe base64 codec

CONTENTS

SYNOPSIS



  use MIME::Base64::URLSafe;
 
  $encoded = urlsafe_b64encode(Alladdin: open sesame);
  $decoded = urlsafe_b64decode($encoded);



DESCRIPTION

This module is a perl version of python’s URL-safe base64 encoder / decoder.

When embedding binary data in URL, it is preferable to use base64 encoding. However, two characters (’+’ and ’/’) used in the standard base64 encoding have special meanings in URLs, often leading to re-encoding with URL-encoding, or worse, interoperability problems.

To overcome the problem, the module provides a variation of base64 codec compatible with python’s urlsafe_b64encode / urlsafe_b64decode.

Modification rules from base64:



    use - and _ instead of + and /
    no line feeds
    no trailing equals (=)



The following functions are provided:



    urlsafe_b64encode($str)
    urlsafe_b64decode($str)



If you prefer not to import these routines to your namespace, you can call them as:



    use MIME::Base64::URLSafe ();
    $encoded = MIME::Base64::URLSafe::encode($decoded);
    $decoded = MIME::Base64::URLSafe::decode($encoded);



SEE ALSO

MIME::Base64

Fore more discussion on using base64 encoding in URL applications, see: http://en.wikipedia.org/wiki/Base64#URL_Applications

AUTHOR

Kazuho Oku <kazuho ___at___ labs.cybozu.co.jp>

Copyright (C) 2006 Cybozu Labs, Inc.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MIME::BASE64::URLSAFE (3) 2006-01-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.