开发者

How to implement SHA 1 Algorithm in Java

i want to implement SHA 1 Algorithm using java. Can any one help me


开发者_如何学Go

Refer this


Not sure quite what you're asking; Wikipedia has pseudo-code: http://en.wikipedia.org/wiki/SHA-1 you should be able to code it up in java from that relativly easily... Did you have any specific question about doing it, or...?


I think you can just use java.security.MessageDigest. For ASCII data this is as simple as

String src = ...
MessageDigest md = MessageDigest.getInstance("SHA-1");
String sha1 = new String(md.digest(src.getBytes()));


Just don't do it, load the bouncycastle libraries and use them. Or look at their source, and then you know one way how to implement it :).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜