<script language="vbscript">
' Aother: 奔腾的心
' QQ: 7180001
' Date: 2008-01-17
Class mShift
Private m_lPower2(31)
Public Function RShift(ByVal lThis, ByVal lBits)
On Error Resume Next
Init
If (lBits <= 0) Then
RShift = lThis
ElseIf (lBits > 63) Then
' .. error ...
ElseIf (lBits > 31) Then
RShift = 0
Else
If (lThis And m_lPower2(31 - lBits)) = m_lPower2(31 - lBits) Then
RShift = (lThis And (m_lPower2(31 - lBits) - 1)) * m_lPower2(lBits) Or
m_lPower2(31)
Else
RShift = (lThis And (m_lPower2(31 - lBits) - 1)) * m_lPower2(lBits)
End If
End If
End Function
Public Function LShift(ByVal lThis, ByVal lBits)
On Error Resume Next
Init
If (lBits <= 0) Then
LShift = lThis
ElseIf (lBits > 63) Then
' ... error ...
ElseIf (lBits > 31) Then
LShift = 0
Else
If (lThis And m_lPower2(31)) = m_lPower2(31) Then
不错的主要用于加密的vbs(asp)位移运算类
内容版权声明:除非注明,否则皆为本站原创文章。