变态重口极致另类在线-波多久久夜色精品国产-波多野结衣在线观看一区-波多野结衣在线观看一区二区-污污的网站免费阅读-污污视频网址

軟件首頁 |  文章首頁
最新更新 軟件分類 設(shè)為首頁 加入收藏 聯(lián)系我們
當前位置:首頁文章首頁 IT學院 VB

VB中實現(xiàn)MD5加密

作者:東坡下載  來源:uzzf  發(fā)布時間:2010-10-14 14:28:11  點擊:

Private Const S11 = 7
Private Const S12 = 12
Private Const S13 = 17
Private Const S14 = 22
Private Const S21 = 5
Private Const S22 = 9
Private Const S23 = 14
Private Const S24 = 20
Private Const S31 = 4
Private Const S32 = 11
Private Const S33 = 16
Private Const S34 = 23
Private Const S41 = 6
Private Const S42 = 10
Private Const S43 = 15
Private Const S44 = 21

'=
'= Class Variables
'=
Private State(4) As Long
Private ByteCounter As Long
Private ByteBuffer(63) As Byte

'=
'= Class Properties
'=
Property Get RegisterA() As String
    RegisterA = State(1)
End Property

Property Get RegisterB() As String
    RegisterB = State(2)
End Property

Property Get RegisterC() As String
    RegisterC = State(3)
End Property

Property Get RegisterD() As String
    RegisterD = State(4)
End Property


'=
'= Class Functions
'=

'
' Function to quickly digest a file into a hex string
'
Public Function DigestFileToHexStr(FileName As String) As String
    Open FileName For Binary Access Read As #1
    MD5Init
    Do While Not EOF(1)
        Get #1, , ByteBuffer
        If Loc(1) < LOF(1) Then
            ByteCounter = ByteCounter + 64
            MD5Transform ByteBuffer
        End If
    Loop
    ByteCounter = ByteCounter + (LOF(1) Mod 64)
    Close #1
    MD5Final
    DigestFileToHexStr = GetValues
End Function

'
' Function to digest a text string and output the result as a string
' of hexadecimal characters.
'
Public Function DigestStrToHexStr(SourceString As String) As String
    MD5Init
    MD5Update Len(SourceString), StringToArray(SourceString)
    MD5Final
    DigestStrToHexStr = GetValues
End Function

'
' A utility function which converts a string into an array of
' bytes.
'
Private Function StringToArray(InString As String) As Byte()
    Dim I As Integer
    Dim bytBuffer() As Byte
    ReDim bytBuffer(Len(InString))
    For I = 0 To Len(InString) - 1
        bytBuffer(I) = Asc(Mid(InString, I + 1, 1))
    Next I
    StringToArray = bytBuffer
End Function

'
' Concatenate the four state vaules into one string
'
Public Function GetValues() As String
    GetValues = LongToString(State(1)) & LongToString(State(2)) & LongToString(State(3)) & LongToString(State(4))
End Function

'
' Convert a Long to a Hex string
'
Private Function LongToString(Num As Long) As String
        Dim a As Byte
        Dim b As Byte
        Dim c As Byte
        Dim d As Byte
       
        a = Num And &HFF&
        If a < 16 Then
            LongToString = "0" & Hex(a)
        Else
            LongToString = Hex(a)
        End If
              
        b = (Num And &HFF00&) \ 256
        If b < 16 Then
            LongToString = LongToString & "0" & Hex(b)
        Else
            LongToString = LongToString & Hex(b)
        End If
       
        c = (Num And &HFF0000) \ 65536
        If c < 16 Then
            LongToString = LongToString & "0" & Hex(c)
        Else
            LongToString = LongToString & Hex(c)
        End If
      
        If Num < 0 Then
            d = ((Num And &H7F000000) \ 16777216) Or &H80&
        Else
            d = (Num And &HFF000000) \ 16777216
        End If
       
        If d < 16 Then
            LongToString = LongToString & "0" & Hex(d)
        Else
            LongToString = LongToString & Hex(d)
        End If
   
End Function

Tags:

VBMD5加密
首頁 上一頁 [1] [2] [3] [4] [5]  下一頁 尾頁

文章評論

欄目導(dǎo)航

本類推薦文章

關(guān)于本站 | 網(wǎng)站幫助 | 廣告合作 | 下載聲明 | 友情連接 | 網(wǎng)站地圖
Copyright © 20098-2010 uzzf下載站. All Rights Reserved .
主站蜘蛛池模板: 欧美白人最猛性xxxxx | 天天色天天草 | 天天舔天天操天天干 | 午夜在线观看完整高清免费 | 成人免费大片黄在线观看com | 日日摸日日 | 国产欧美日韩在线观看精品 | 欧美人善交vides0 | 黄网站色视频免费观看 | 久久天天| 久久精品视频日本 | 91短视频在线观看免费最新91 | 免费国产a国产片高清 | 高清女女同性一区二区 | 国产午夜影院 | 日韩欧美亚洲一区二区综合 | www.一级片| 中国欧美日韩一区二区三区 | 亚洲第九页| 日韩一级欧美一级在线观看 | 最近中文2019视频在线 | 久久天天| 两个人看的www免费 两个人看的www高清免费视频 | 亚洲视频一区在线观看 | 国产免费黄色大片 | 人人揉人人添人人捏人人看 | 欧美三级欧美一级 | 久久精品免观看国产成人 | 亚洲不卡视频在线观看 | 1024日本| 青青草国产免费久久久91 | 黄色体验区 | 一本无线乱码不卡一二三四 | 国产特黄特色a级在线视频 国产特黄特色a级在线视 | 久久精品视频日本 | 国产黄大片在线观看 | 天天做日日爱 | 精品国语国产在线对白 | 最近2019中文字幕免费看最新 | 经典三级四虎在线观看 | 激情综合五月 |