-3

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.

0

1 Answer 1

0

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)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks very much! My app now works!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.