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.2 date: 2019/12/13 20:32:11
user: cg
file: Base64UrlCoder.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

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

copyright

COPYRIGHT (c) 2018 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:02:05 GMT