-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.

thomasb
  • 1
  • 3

1 Answers1

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)

JeffreyH
  • 31
  • 5