- 606
- 0
- 约1.12万字
- 约 14页
- 2017-04-25 发布于河南
- 举报
在excel中用VB实现MD5加密
新建一个启用宏的工作簿(xlsm)
在“开发工具”打开“查看代码”,然后在模块中增加vb代码
返回excel中,在单元格输入“=MD5(A2)”,或者输入“=MD5(12345)”,然后按回车,就会出现md5加密后的密文
Vb代码如下:
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32
Private m_lOnBits(30)
Private m_l2Power(30)
Private Function LShift(lValue, iShiftBits)
If iShiftBits = 0 Then
LShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And 1 Then
LShift = Else
LShift = 0
End If
Exit Function
ElseIf iShiftBits 0 Or iShiftBits 31 Then
原创力文档

文档评论(0)