Encryption and decryption classes _asp class class written in ASP

Source: Internet
Author: User
Class Base64class
REM Const
Dim sbase_64_characters ' Conversion Code
Dim lenstring ' Computes the length of a string
Dim icount ' Counter
Dim ReturnValue ' return Value
Dim Tempchar ' Cached characters
Dim tempstring ' Cached String
Dim paramstring ' Parameter String
Dim Temhex ' Cache Cache hex
Dim Templow ' Cache Low
Dim Temphigh ' Cache High
Dim mod3string '
Dim mod4string '
Dim Tempbinary '
Dim Tempbyteone '
Dim Tempbytetwo '
Dim Tempbytethree '
Dim Tempbytefour '
Dim Tempsavebitsone '
Dim Tempsavebitstwo '
'********************************************
' Begin initializing Class
'********************************************
Private Sub Class_Initialize ()
Sbase_64_characters = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/" End Sub
'********************************************
' End Initialization class '
********************************************
'********************************************
' Begin destroying class
'********************************************
Private Sub Class_Terminate ()
Sbase_64_characters= "" End Sub
'********************************************
' End Destroy class
'********************************************
'********************************************
' Begin BASE64 encoding an ANSI-encoded string
'********************************************
Public Function Encode (paramstring)
Tempstring= ""
Returnvalue= ""
Lenstring=len (paramstring)
If Lenstring<1 Then
Encode=returnvalue
Else
Mod3string=lenstring MoD 3
' The number of complements is for ease of calculation.
If Mod3string>0 Then
Lenstring=lenstring+3-mod3string
Lenstring=lenstring-3
End If
Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.