Class base64class
Rem const
Dim sbase_64_characters 'conversion code
Dim lenstring 'calculates the length of the string.
Dim icount' counter
Dim returnvalue returned value
Dim tempchar 'cached characters
Dim tempstring 'cache string
Dim paramstring 'parameter string
Dim temhex 'cache hex
Dim templow
Dim temphigh 'high Cache
Dim mod3string'
Dim mod4string'
Dim tempbinary'
Dim tempbyteone'
Dim tempbytetwo'
Dim tempbytethree'
Dim tempbytefour'
Dim tempsavebitsone'
Dim tempsavebitstwo'
'*************************************** *****
'Begin' initialization class
'*************************************** *****
Private sub class_initialize ()
Sbase_64_characters = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789 +/" End sub
'*************************************** *****
'End initialization class'
**************************************** ****
'*************************************** *****
'Begint' destruction class
'*************************************** *****
Private sub class_terminate ()
Sbase_64_characters = "" End sub
'*************************************** *****
'End destruction class
'*************************************** *****
'*************************************** *****
'Begin' encodes ANSI-encoded strings in base64 format.
'*************************************** *****
Public Function encode (paramstring)
Tempstring = ""
Returnvalue = ""
Lenstring = Len (paramstring)
If lenstring <1 then
Encode = returnvalue
Else
Mod3string = lenstring mod 3
'The complement BITs are used to facilitate computation.
If mod3string> 0 then
Lenstring = lenstring + 3-mod3string
Lenstring = lenString-3
End if
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service