Reputation: 14662
i want to implement SHA 1 Algorithm using java. Can any one help me
Upvotes: 0
Views: 5294
Reputation: 3001
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()));
Upvotes: 1
Reputation: 28074
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 :).
Upvotes: 0
Reputation: 615
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...?
Upvotes: 2