public final class Passwords extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
generate()
Generates a pseudo-random password (10 alphanumeric characters).
|
static byte[] |
hash(String password)
Hashes the given password (using SCrypt).
|
static boolean |
verify(String password,
byte[] hash)
Verifies that the given password matches the hashed one.
|
public static String generate()
public static byte[] hash(String password)
password - the password to hash.NullPointerException - if password is null.public static boolean verify(String password, byte[] hash)
password - the password to verify.hash - the hashed password.NullPointerException - if one of the arguments is null.Copyright © 2012–2015. All rights reserved.