加入收藏
联系我们
关于我们
 您现在的位置: 亿聪 >> 网络学院 >> 网络编程 >> 其它 >> 正文  
  MD5算法的T-SQL实现(FOR SQL2000)       ★★★
MD5算法的T-SQL实现(FOR SQL2000)
[ 作者:Rambo Qian    转贴自:aspsky    点击数:34405    更新时间:2003/8/28    文章录入:亿聪 ]
      WHEN 19 THEN 524288    -- 00000000000010000000000000000000
      WHEN 20 THEN 1048576   -- 00000000000100000000000000000000
      WHEN 21 THEN 2097152   -- 00000000001000000000000000000000
      WHEN 22 THEN 4194304   -- 00000000010000000000000000000000
      WHEN 23 THEN 8388608   -- 00000000100000000000000000000000
      WHEN 24 THEN 16777216   -- 00000001000000000000000000000000
      WHEN 25 THEN 33554432   -- 00000010000000000000000000000000
      WHEN 26 THEN 67108864   -- 00000100000000000000000000000000
      WHEN 27 THEN 134217728  -- 00001000000000000000000000000000
      WHEN 28 THEN 268435456  -- 00010000000000000000000000000000
      WHEN 29 THEN 536870912  -- 00100000000000000000000000000000
      WHEN 30 THEN 1073741824  -- 01000000000000000000000000000000
      ELSE 0
    END
  RETURN(@iRes)
END
GO

IF EXISTS(SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[MD5_LShift]') AND xtype IN(N'FN', N'IF', N'TF'))
  DROP FUNCTION [dbo].[MD5_LShift]
GO
/*****************************************************************************
* Name: MD5_LShift
* Description: MD5_LShift
*****************************************************************************/
CREATE FUNCTION dbo.MD5_LShift(
   @iValue    INT
  ,@iShiftBits  TINYINT
)
RETURNS INT
WITH ENCRYPTION
AS
BEGIN
  DECLARE @iRes  BIGINT
  SET @iRes = CAST(@iValue AS BINARY(8))
  SET @iRes = @iRes * dbo.MD5_m_2Power(@iShiftBits)
  RETURN(CAST(@iRes & 0x00000000FFFFFFFF AS BINARY(4)))
END
GO

IF EXISTS(SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[MD5_RShift]') AND xtype IN(N'FN', N'IF', N'TF'))
  DROP FUNCTION [dbo].[MD5_RShift]
GO
/*****************************************************************************
* Name: MD5_RShift
* Description: MD5_RShift
*****************************************************************************/
CREATE FUNCTION dbo.MD5_RShift(
   @iValue    INT
  ,@iShiftBits  TINYINT
)
RETURNS INT
WITH ENCRYPTION
AS
BEGIN
  DECLARE @iRes  BIGINT
  SET @iRes = CAST(@iValue AS BINARY(8))
  SET @iRes = @iRes / dbo.MD5_m_2Power(@iShiftBits)
  RETURN(CAST(@iRes & 0x00000000FFFFFFFF AS BINARY(4)))
END
GO

IF EXISTS(SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[MD5_RotateLeft]') AND xtype IN(N'FN', N'IF', N'TF'))

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]  下一页

  • 上一篇文章: 没有了

  • 下一篇文章: MD5算法研究
  • 发表评论】【告诉好友】【打印此文】【关闭窗口
     最新5篇热点文章
  • Knoppix 4.0.2 免硬盘免安…[15797]

  • 通过ASP记录进行分页[20012]

  • ASP开发准则[11932]

  • ASP组件指南[11943]

  • ASP指南[11967]

  •  
     最新5篇推荐文章
  • Knoppix 4.0.2 免硬盘免安…[15797]

  • 如何让Win 2003系统更加安…[13301]

  • Nero超刻简明教程[34139]

  • PS商业实战-来杯茶,行吗?…[7255]

  • ASP深度揭密(下)[12554]

  •  
     相 关 文 章
  • MD5算法研究[12631]


  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
        没有任何评论
    设为首页 | 加入收藏 | 关于我们 | 联系我们 | 友情链接 | 版权声明 | 管理登录
    Copyright © 2000-2022 Yicong.com.All Rights Reserved.
    亿聪 版权所有 E-mail: