asp 一些支付接口(38)


m_lOnBits(18) = CLng(524287)
m_lOnBits(19) = CLng(1048575)
m_lOnBits(20) = CLng(2097151)
m_lOnBits(21) = CLng(4194303)
m_lOnBits(22) = CLng(8388607)
m_lOnBits(23) = CLng(16777215)
m_lOnBits(24) = CLng(33554431)
m_lOnBits(25) = CLng(67108863)
m_lOnBits(26) = CLng(134217727)
m_lOnBits(27) = CLng(268435455)
m_lOnBits(28) = CLng(536870911)
m_lOnBits(29) = CLng(1073741823)
m_lOnBits(30) = CLng(2147483647)

m_l2Power(0) = CLng(1)
m_l2Power(1) = CLng(2)
m_l2Power(2) = CLng(4)
m_l2Power(3) = CLng(8)
m_l2Power(4) = CLng(16)
m_l2Power(5) = CLng(32)
m_l2Power(6) = CLng(64)
m_l2Power(7) = CLng(128)
m_l2Power(8) = CLng(256)
m_l2Power(9) = CLng(512)
m_l2Power(10) = CLng(1024)
m_l2Power(11) = CLng(2048)
m_l2Power(12) = CLng(4096)
m_l2Power(13) = CLng(8192)
m_l2Power(14) = CLng(16384)
m_l2Power(15) = CLng(32768)
m_l2Power(16) = CLng(65536)
m_l2Power(17) = CLng(131072)
m_l2Power(18) = CLng(262144)
m_l2Power(19) = CLng(524288)
m_l2Power(20) = CLng(1048576)
m_l2Power(21) = CLng(2097152)
m_l2Power(22) = CLng(4194304)
m_l2Power(23) = CLng(8388608)
m_l2Power(24) = CLng(16777216)
m_l2Power(25) = CLng(33554432)
m_l2Power(26) = CLng(67108864)
m_l2Power(27) = CLng(134217728)
m_l2Power(28) = CLng(268435456)
m_l2Power(29) = CLng(536870912)
m_l2Power(30) = CLng(1073741824)

'
' The main HMAC function
'
Function HMAC(text,key)
Dim hkey
Dim ipad(63)
Dim opad(63)
Dim odata(79)
Dim idata()
ReDim idata(64 + Len(text) - 1)

If Len(key)>64 Then
hkey = calcMD5(key)
Else
hkey = key
End If

Dim x

For x=0 To 63
idata(x) = &h36
odata(x) = &h5C
ipad(x) = &h36
opad(x) = &h5C

Next

For x=0 To Len(hkey)-1
ipad(x) = ipad(x) Xor Asc(CStr(Mid(hkey,x+1,1)))
opad(x) = opad(x) Xor Asc(CStr(Mid(hkey,x+1,1)))
idata(x) = ipad(x) And &hFF
odata(x) = opad(x) And &hFF
Next

For x=0 To Len(text)-1
idata(64+x) = Asc(CStr(Mid(text,x+1,1))) And &hFF
Next

Dim innerhashout
innerhashout = binl2byt(b_calcMD5(idata))

For x=0 To 15
odata(64+x) = innerhashout(x)
Next

HMAC = binl2hex(b_calcMD5(odata))

End Function
'
' The main MD5 function
'
Function MD5(sMessage)
Dim x, r

x = ConvertToWordArray(sMessage)
r = coreMD5(x)

MD5 = LCase(r(0) + r(1) + r(2) + r(3))
End Function

'
' main auxilliary functions
'
Function calcMD5(str)
calcMD5 = binl2hex(coreMD5(str2binl(str)))
End Function

Function b_calcMD5(barray)
b_calcMD5 = coreMD5(bytarray2binl(barray))
End Function

Function coreMD5(x)
Dim k
Dim AA
Dim BB
Dim CC
Dim DD
Dim a
Dim b
Dim c
Dim d

Const S11 = 7
Const S12 = 12
Const S13 = 17
Const S14 = 22
Const S21 = 5
Const S22 = 9
Const S23 = 14
Const S24 = 20
Const S31 = 4

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2294.html