DROP FUNCTION [dbo].[MD5_RotateLeft] GO /***************************************************************************** * Name: MD5_RotateLeft * Description: MD5_RotateLeft *****************************************************************************/ CREATE FUNCTION dbo.MD5_RotateLeft( @iValue INT ,@iShiftBits TINYINT ) RETURNS INT WITH ENCRYPTION AS BEGIN RETURN(dbo.MD5_LShift(@iValue, @iShiftBits) | dbo.MD5_RShift(@iValue, (32 - @iShiftBits))) END GO
IF EXISTS(SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[MD5_AddUnsigned]') AND xtype IN(N'FN', N'IF', N'TF')) DROP FUNCTION [dbo].[MD5_AddUnsigned] GO /***************************************************************************** * Name: MD5_AddUnsigned * Description: MD5_AddUnsigned *****************************************************************************/ CREATE FUNCTION dbo.MD5_AddUnsigned( @iX INT ,@iY INT ) RETURNS INT WITH ENCRYPTION AS BEGIN DECLARE @iRes BIGINT SET @iRes = CAST(CAST(@iX AS BINARY(8)) AS BIGINT) + CAST(CAST(@iY AS BINARY(8)) AS BIGINT) RETURN(CAST(@iRes & 0x00000000FFFFFFFF AS BINARY(4))) END GO
IF EXISTS(SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[MD5_F]') AND xtype IN(N'FN', N'IF', N'TF')) DROP FUNCTION [dbo].[MD5_F] GO /***************************************************************************** * Name: MD5_F * Description: MD5_F *****************************************************************************/ CREATE FUNCTION dbo.MD5_F( @x INT ,@y INT ,@z INT ) RETURNS INT WITH ENCRYPTION AS BEGIN RETURN((@x & @y) | ((~@x) & @z)) END GO
IF EXISTS(SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[MD5_G]') AND xtype IN(N'FN', N'IF', N'TF')) DROP FUNCTION [dbo].[MD5_G] GO /***************************************************************************** * Name: MD5_G * Description: MD5_G *****************************************************************************/ CREATE FUNCTION dbo.MD5_G( @x INT ,@y INT ,@z INT ) RETURNS INT WITH ENCRYPTION AS BEGIN RETURN((@x & @z) | (@y & (~@z)))
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] 下一页 |