• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 一套加解密字符串的函數

    發表于:2007-07-14來源:作者:點擊數: 標簽:
    % Function Encrypt(theNumber) On Error Resume Next Dim n, szEnc, t, HiN, LoN, i n = CDbl((theNumber + 1570) ^ 2 - 7 * (theNumber + 1570) - 450) If n 0 Then szEnc = "R" Else szEnc = "J" n = CStr(abs(n)) For i = 1 To Len(n) step 2 t = Mid(n,
    <%
    Function Encrypt(theNumber)
    On Error Resume Next
    Dim n, szEnc, t, HiN, LoN, i
    n = CDbl((theNumber + 1570) ^ 2 - 7 * (theNumber + 1570) - 450)
    If n < 0 Then szEnc = "R" Else szEnc = "J"
    n = CStr(abs(n))
    For i = 1 To Len(n) step 2
    t = Mid(n, i, 2)
    If Len(t) = 1 Then
    szEnc = szEnc & t
    Exit For
    End If
    HiN = (CInt(t) And 240) / 16
    LoN = CInt(t) And 15
    szEnc = szEnc & Chr(Asc("M") + HiN) & Chr(Asc("C") + LoN)
    Next
    Encrypt = szEnc
    End Function

    Function Decrypt(theNumber)
    On Error Resume Next
    Dim e, n, sign, t, HiN, LoN, NewN, i
    e = theNumber
    If Left(e, 1) = "R" Then sign = -1 Else sign = 1
    e = Mid(e, 2)
    NewN = ""
    For i = 1 To Len(e) step 2
    t = Mid(e, i, 2)
    If Asc(t) >= Asc("0") And Asc(t) <= Asc("9") Then
    NewN = NewN & t
    Exit For
    End If
    HiN = Mid(t, 1, 1)
    LoN = Mid(t, 2, 1)
    HiN = (Asc(HiN) - Asc("M")) * 16
    LoN = Asc(LoN) - Asc("C")
    t = CStr(HiN Or LoN)
    If Len(t) = 1 Then t = "0" & t
    NewN = NewN & t
    Next
    e = CDbl(NewN) * sign
    Decrypt = CLng((7 + sqr(49 - 4 * (-450 - e))) / 2 - 1570)
    End Function
    %>
    <html><body>
    Original number: 69 <br>
    Encrypt(69) returns: JNMQMOJ8 <br>
    Decrypt("JNMQMOJ8") returns: 69
    <p>
    Another example using variables instead: <br>
    Encrypt(Request.Form("ID")) <br>
    Encrypt(myVar) <br>
    Decrypt(Request.QueryString("id")) <br>
    Decrypt("JNMQMOJ8") <br>
    Decrypt(myVar)

    </body></html>


    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>