知识分享
分享创造价值 合作实现共赢

知识分享

当前位置: 首页 > 知识分享

微信小程序 MD5js使用方法,请求接口轮播图

发布时间:2019-12-16 21:37:26作者:admin点击:

作者:woshihaiyong168,来自原文地址

一:MD5 方法js

更多md5相关内容,可以查看此帖:MD5加密中文的结果不一致
生成的文件可以放在 utils文件中哦!!!

/*   * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message   * Digest Algorithm, as defined in RFC 1321.   * Version 1.1 Copyright (C) Paul Johnston 1999 - 2002.   * Code also contributed by Greg Holt   * See http://pajhome.org.uk/site/legal.html for details.   */    /*   * Add integers, wrapping at 2^32. This uses 16-bit operations internally   * to work around bugs in some JS interpreters.   */    function safe_add(x, y)    {      var lsw = (x & 0xFFFF) + (y & 0xFFFF)      var msw = (x >> 16) + (y >> 16) + (lsw >> 16)      return (msw << 16) | (lsw & 0xFFFF)    }    /*   * Bitwise rotate a 32-bit number to the left.   */    function rol(num, cnt)    {      return (num << cnt) | (num >>> (32 - cnt))    }    /*   * These functions implement the four basic operations the algorithm uses.   */    function cmn(q, a, b, x, s, t)    {      return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)    }    function ff(a, b, c, d, x, s, t)    {      return cmn((b & c) | ((~b) & d), a, b, x, s, t)    }    function gg(a, b, c, d, x, s, t)    {      return cmn((b & d) | (c & (~d)), a, b, x, s, t)    }    function hh(a, b,
          

TOP

QQ客服

18910140161