eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Base64UrlCoder':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Base64UrlCoder


Inheritance:

   Object
   |
   +--Visitor
      |
      +--AspectVisitor
         |
         +--ObjectCoder
            |
            +--BaseNCoder
               |
               +--Base64Coder
                  |
                  +--Base64UrlCoder

Package:
stx:libbasic2
Category:
System-Storage
Version:
rev: 1.1 date: 2018/09/30 13:55:46
user: cg
file: Base64UrlCoder.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Claus Gittinger

Description:


A variant of base64 encoding which generates url- and filename save encodings.
Same as Base64 except that instead of plus and slash, minus and underline are generated.

The main entry point API is
    Base64UrlCoder encode:aStringOrBytes
and
    Base64UrlCoder decode:aString

If the decoder should return a string, use
    Base64UrlCoder decodeAsString:aString.



[instance variables:]

[class variables:]
    Base64UrlMapping         String   Mapping from bytes (with 6 valid bits)
                                      to Base64Url characters
    Base64UrlReverseMapping  Array    Mapping from Base64Url characters to 6-bit-Bytes


Related information:

    RFC
    [ttps]

Class protocol:

initialization
o  initializeMappings
initialize class variables

usage example(s):

     Base64UrlMapping := nil.
     self initializeMappings

o  mapping

o  reverseMapping


Examples:


   (Base64Coder encode:#[0 0 16r3F]) = 'AAA/'
   (Base64Coder decode:'AAA/') = #[0 0 63]
   (Base64UrlCoder encode:#[0 0 16r3F]) = 'AAA_'
   (Base64UrlCoder decode:'AAA_') = #[0 0 63]


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 19 Sep 2019 09:26:49 GMT