I was wondering if there is any way to get the PHP SHA1 with raw returning in Java. Just like this in PHP: sha1("abc123", true) Anyone got an idea? It would be appreciated very much.
Asked
Modified
9 years, 10 months ago
Viewed
340 times
Part
of PHP and Mobile Development Collectives
1 Answer
You could write something like
java.security.MessageDigest.getInstance("SHA-1").digest("abc123".getBytes())
(maybe you want to pass the Charset to getBytes()) or use org.apache.commons.codec.digest.DigestUtils#sha1(String)
1 Comment
thomasb
Thanks very much! My app now works!