Created
August 27, 2012 02:58
-
-
Save shazinahmed/3485195 to your computer and use it in GitHub Desktop.
url2png md5 hash token generation code
This file contains hidden or 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
public byte[] generateToken(String url,String apiKey) throws NoSuchAlgorithmException{ | |
MessageDigest md = MessageDigest.getInstance("MD5");// throws NoSuchAlgorithmException | |
StringBuffer buffer = new StringBuffer(url); | |
buffer.append(apiKey);//prepare the string to be hashed url+APIKey | |
byte[] token = md.digest(buffer.toString().getBytes()); | |
return token ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment