ASP代码怎么加入MD5

来源:百度知道 编辑:UC知道 时间:2024/06/21 17:28:25
<%
dim UserName,Password
UserName=request.form("UserName")
UserName=replace(UserName,"'","''")
Password=request.form("Password")
Password=replace(Password,"'","''")
if len(UserName)=0 or len(Password)=0 then
response.write"<Script Language=Javascript>window.alert('请完整填写登录信息。\n\n点击确定返回重新输入。');history.back()</Script>"
response.end
end if
%>

请问大家怎么样才能在PASSWORD这个地方加入MD5呢?

Password=MD5(request.form("Password"))

MD5函数代码在很多地方都有下

Password=MD5(request.form("Password"))

下面是MD5函数
<%
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 = &H80000000
Else
LShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If

If (lValue And m_l2Power(31 - iShiftBits)) Then
LShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000
Else
LShift = ((lVa