【问题标题】:Crypto-js lib is not available anymoreCrypto-js lib 不再可用
【发布时间】:2016-09-08 07:48:53
【问题描述】:

我多年来一直使用以下库,但现在它不可用。 http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js

有人可以帮忙寻找替代方案吗?

【问题讨论】:

标签: cryptojs


【解决方案1】:

从这里下载您需要的库源:https://code.google.com/archive/p/crypto-js/downloads

然后将它们放在您自己的服务器上...然后替换 http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js 经过 /directory_where_you_put_the_download/rollups/md5.js

它对我有用。

【讨论】:

  • code.google.com 链接很好,它链接到包含文件的 zip。您提到的其他链接已损坏。例如wget http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js 给出 404,你也需要先加载 core.js。看我的回答
【解决方案2】:

它仍然托管在 cdnjs 上,我找到了它的工作 URL 查看我的答案 How to generate an MD5 file hash in JavaScript?

单个 js 文件(如 md5.js)的 URL 已更改(除此之外,您需要先加载 core.js)

尝试<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/core.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js"></script> 并查看https://cdnjs.com/libraries/crypto-js 获取网址

你可以使用例如代码

var hash = CryptoJS.MD5("Message");
console.log(hash);

【讨论】:

    【解决方案3】:

    当我需要这样的东西时,我总是访问https://cdnjs.com/libraries/crypto-js。免费和开源的 CDN。你可以在那里找到很多版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-07
      • 1970-01-01
      • 2023-03-17
      • 2022-11-19
      • 2021-09-22
      • 2016-05-16
      • 2020-12-16
      • 1970-01-01
      相关资源
      最近更新 更多