public class HashEncoder extends Object
| Constructor and Description |
|---|
HashEncoder() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
encodePwd(String pwd)
Returns the hash value of the string using "SHA-1" algorithm
|
static void |
main(String[] args) |
boolean |
matchPwd(String encoded,
String plain)
Hashes the given plain text using "SHA-1 " and compares it to the given
encoded value
|
static void |
testEncoding(String encStr) |
public byte[] encodePwd(String pwd)
pwd - the string to be hashedpublic boolean matchPwd(String encoded, String plain)
encoded - the string representation of the encoded byte array (should be
UTF-16)the - plain text to be comparedpublic static void testEncoding(String encStr) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static void main(String[] args)
Copyright © 2019 com.github.mfjamil. All rights reserved.