|
Class: Base64UrlCoder
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
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
copyrightCOPYRIGHT (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.
initialization
-
initializeMappings
-
initialize class variables
Usage example(s):
Base64UrlMapping := nil.
self initializeMappings
|
-
mapping
-
-
reverseMapping
-
(Base64Coder encode:#[0 0 16r3F]) = 'AAA/'
|
(Base64Coder decode:'AAA/') = #[0 0 63]
|
(Base64UrlCoder encode:#[0 0 16r3F]) = 'AAA_'
|
(Base64UrlCoder decode:'AAA_') = #[0 0 63]
|
|