I\'m looking for a java equivalent to this php call:
hash_hmac(\'sha1\', \"test\", \"secret\")
I tried this, using java.crypto.Mac, but the
Haven't tested it, but try this:
BigInteger hash = new BigInteger(1, digest); String enc = hash.toString(16); if ((enc.length() % 2) != 0) { enc = "0" + enc; }
This is snapshot from my method that makes java's md5 and sha1 match php.