Created
November 17, 2017 12:34
-
-
Save HootsuiteJosh/2f6dee3d7fb39464767580af79973ae5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.codec.binary.Hex; | |
import org.apache.commons.codec.digest.DigestUtils; | |
// ... | |
public String computeHash(String uId, String ts, String secret) { | |
byte[] digest = DigestUtils.sha512(uId + ts + secret); | |
char[] hex = Hex.encodeHex(digest); | |
return new String(hex); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment