文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>SQL Server中的MD5实现方法

SQL Server中的MD5实现方法

时间:2010-09-05  来源:ggf6318

--SQL Server中的MD5实现方法
/*****************************************************************************
* Name: MD5_II
* Description: MD5_II
*****************************************************************************/
CREATE FUNCTION dbo.MD5_II(
@a INT,
@b INT,
@c INT,
@d INT,
@x INT,
@s INT,
@ac INT
)
RETURNS INT
WITH ENCRYPTION
AS
BEGIN
  SET @a = dbo.MD5_AddUnsigned(@a, dbo.MD5_AddUnsigned(dbo.MD5_AddUnsigned(dbo.MD5_I(@b, @c, @d), @x), @ac))
  SET @a = dbo.MD5_RotateLeft(@a, @s)
  SET @a = dbo.MD5_AddUnsigned(@a, @b)
  RETURN(@a)
END
GO
/*****************************************************************************
* Name: MD5_HH
* Description: MD5_HH
*****************************************************************************/
CREATE FUNCTION dbo.MD5_HH(
@a INT,
@b INT,
@c INT,
@d INT,
@x INT,
@s INT,
@ac INT
)
RETURNS INT
WITH ENCRYPTION
AS
BEGIN
  SET @a = dbo.MD5_AddUnsigned(@a, dbo.MD5_AddUnsigned(dbo.MD5_AddUnsigned(dbo.MD5_H(@b, @c, @d), @x), @ac))
  SET @a = dbo.MD5_RotateLeft(@a, @s)
  SET @a = dbo.MD5_AddUnsigned(@a, @b)
  RETURN(@a)
END
GO


/*****************************************************************************
* Name: MD5_GG
* Description: MD5_GG
*****************************************************************************/
CREATE FUNCTION dbo.MD5_GG(
@a INT,
@b INT,
@c INT,
@d INT,
@x INT,
@s INT,
@ac INT
)
RETURNS INT
WITH ENCRYPTION
AS
BEGIN
  SET @a = dbo.MD5_AddUnsigned(@a, dbo.MD5_AddUnsigned(dbo.MD5_AddUnsigned(dbo.MD5_G(@b, @c, @d), @x), @ac))
  SET @a = dbo.MD5_RotateLeft(@a, @s)
  SET @a = dbo.MD5_AddUnsigned(@a, @b)
  RETURN(@a)
END
GO

/*****************************************************************************
* Name: MD5_FF
* Description: MD5_FF
*****************************************************************************/
CREATE FUNCTION dbo.MD5_FF(
@a INT,
@b INT,
@c INT,
@d INT,
@x INT,
@s INT,
@ac INT
)
RETURNS INT
WITH ENCRYPTION
AS
BEGIN
  SET @a = dbo.MD5_AddUnsigned(@a, dbo.MD5_AddUnsigned(dbo.MD5_AddUnsigned(dbo.MD5_F(@b, @c, @d), @x), @ac))
  SET @a = dbo.MD5_RotateLeft(@a, @s)
  SET @a = dbo.MD5_AddUnsigned(@a, @b)
  RETURN(@a)
END
GO

/*****************************************************************************
* Name: MD5_I
* Description: MD5_I
*****************************************************************************/
CREATE FUNCTION dbo.MD5_I(
@x INT
,@y INT
,@z INT
)
RETURNS INT
WITH ENCRYPTION
AS
BEGIN
  RETURN(@y ^ (@x | (

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载