Base64Coder.st
changeset 3547 399b59b67fda
parent 3478 ce272a495f41
child 3763 0d73959c77f3
equal deleted inserted replaced
3546:85cad7a4c32b 3547:399b59b67fda
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2002 by eXept Software AG
     4  COPYRIGHT (c) 2002 by eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   132 "
   134 "
   133 ! !
   135 ! !
   134 
   136 
   135 !Base64Coder class methodsFor:'initialization'!
   137 !Base64Coder class methodsFor:'initialization'!
   136 
   138 
   137 initialize
   139 initializeMappings
   138     "initialize class variables"
   140     "initialize class variables"
   139 
   141 
   140     "65 characters representing the 6-bit values from 0-63 and one pad character"
   142     Base64Mapping isNil ifTrue:[
   141     Base64Mapping := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.
   143         "65 characters representing the 6-bit values from 0-63 and one pad character"
   142     Base64ReverseMapping := ByteArray new:128 withAll:255.
   144         Base64Mapping := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.
   143     Base64Mapping keysAndValuesDo:[:idx :char|
   145         Base64ReverseMapping := ByteArray new:128 withAll:255.
   144         Base64ReverseMapping at:char codePoint put:idx-1.
   146         Base64Mapping keysAndValuesDo:[:idx :char|
       
   147             Base64ReverseMapping at:char codePoint put:idx-1.
       
   148         ].
   145     ].
   149     ].
   146 
   150 
   147     "
   151     "
   148      self initialize
   152      self initializeMappings
   149     "
   153     "
   150 ! !
   154 ! !
   151 
   155 
   152 !Base64Coder methodsFor:'encoding'!
   156 !Base64Coder methodsFor:'encoding'!
   153 
   157 
   270 ! !
   274 ! !
   271 
   275 
   272 !Base64Coder class methodsFor:'documentation'!
   276 !Base64Coder class methodsFor:'documentation'!
   273 
   277 
   274 version
   278 version
   275     ^ '$Header: /cvs/stx/stx/libbasic2/Base64Coder.st,v 1.25 2015-02-03 14:33:12 cg Exp $'
   279     ^ '$Header: /cvs/stx/stx/libbasic2/Base64Coder.st,v 1.26 2015-05-07 20:36:31 cg Exp $'
   276 !
   280 !
   277 
   281 
   278 version_CVS
   282 version_CVS
   279     ^ '$Header: /cvs/stx/stx/libbasic2/Base64Coder.st,v 1.25 2015-02-03 14:33:12 cg Exp $'
   283     ^ '$Header: /cvs/stx/stx/libbasic2/Base64Coder.st,v 1.26 2015-05-07 20:36:31 cg Exp $'
   280 ! !
   284 ! !
   281 
   285 
   282 
       
   283 Base64Coder initialize!