ASP常用函数收藏乱七八糟未整理版(22)
RShift = (RShift or (&H40000000 m_l2Power(iShiftBits - 1)))
End If
End Function
Private Function LShiftByte(bytValue, bytShiftBits)
If bytShiftBits = 0 Then
LShiftByte = bytValue
Exit Function
ElseIf bytShiftBits = 7 Then
If bytValue And 1 Then
LShiftByte = &H80
Else
LShiftByte = 0
End If
Exit Function
ElseIf bytShiftBits < 0 or bytShiftBits > 7 Then
Err.Raise 6
End If
LShiftByte = ((bytValue And m_bytOnBits(7 - bytShiftBits)) * m_byt2Power(bytShiftBits))
End Function
Private Function RShiftByte(bytValue, bytShiftBits)
If bytShiftBits = 0 Then
RShiftByte = bytValue
Exit Function
ElseIf bytShiftBits = 7 Then
If bytValue And &H80 Then
RShiftByte = 1
Else
RShiftByte = 0
End If
Exit Function
ElseIf bytShiftBits < 0 or bytShiftBits > 7 Then
Err.Raise 6
End If
RShiftByte = bytValue m_byt2Power(bytShiftBits)
End Function
Private Function RotateLeft(lValue, iShiftBits)
RotateLeft = LShift(lValue, iShiftBits) or RShift(lValue, (32 - iShiftBits))
End Function
Private Function RotateLeftByte(bytValue, bytShiftBits)
RotateLeftByte = LShiftByte(bytValue, bytShiftBits) or RShiftByte(bytValue, (8 - bytShiftBits))
内容版权声明:除非注明,否则皆为本站原创文章。