JQuery,jssha和SHA512 - 如何调用函数 [英] JQuery, jssha, and SHA512 - How To Call Function

查看:81
本文介绍了JQuery,jssha和SHA512 - 如何调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在成功使用SHA256,而对于我想使用SHA512的网站的管理部分。
我正在使用 http://sourceforge.net/projects/jssha/files中的js /

I've been using SHA256 successfully and for an Admin section of a site I wanted to use SHA512. I'm using the js from http://sourceforge.net/projects/jssha/files/

唯一的问题是似乎无法调用该函数。
with sha256我只需执行以下操作:

The only catch is a can't seem to call the function. with sha256 I just do the following:

 SHA256('data');

但是当我尝试使用sha512时,脚本会在此时停止 - 不起作用 - 例如:

But when I try the same with sha512 the script just stops at that point - doesn't work - eg:

 SHA512('data');

此外,我可以在原始代码中看到SHA256()函数,但不能看到SHA512函数...是否有使用此代码的技巧?我应该使用另一个来源吗?

Also I can see the SHA256() function in the original code but not the SHA512 function... is there a trick to using this code? Another source I should use?

谢谢。

推荐答案

    var shaObj = new jsSHA("This is a Test", "ASCII");
    var hash = shaObj.getHash("SHA-512", "HEX");

这篇关于JQuery,jssha和SHA512 - 如何调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆