PHP 的 md5() 的 Javascript 等价物也适用于多字节字符串?

发布于 2024-07-19 07:26:42 字数 242 浏览 4 评论 0原文

编辑: 问题中提到的脚本和答案中指出的另一个脚本,都可以很好地处理多字节字符串 - 结果我的问题在其他地方。

有谁知道这样的实施? http://phpjs.org/functions/view/469 上的脚本运行良好,只是不在多字节字符串上。

EDIT: the script mentioned in the question, and the other script pointed among the answers, both work just fine with multibyte strings - turned out my problem was elsewhere.

Does anyone know of such implementation? The script at http://phpjs.org/functions/view/469 works well, just not on multibyte strings.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

歌入人心 2024-07-26 07:26:42

此实现似乎可以正确处理 UTF-8 字符串。 如果您想测试演示,请确保首先在浏览器设置中将页面编码更改为 UTF-8。

This implementation seems to handle UTF-8 strings correctly. If you want to test the demo, make sure you change the encoding of the page to UTF-8 in your browser settings first.

会傲 2024-07-26 07:26:42

您发布的脚本具有 str = utf8_encode(str);
您可能应该删除此行并将西里尔字母作为 UTF-8 传递。

The script you've posted has str = utf8_encode(str);.
You should probably remove this line and pass in your Cyrillic as UTF-8.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文