public class BCrypt extends Object
Modifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_COST |
Constructor | Description |
---|---|
BCrypt() |
Modifier and Type | Method | Description |
---|---|---|
static String |
hash(char[] password,
int cost) |
|
static boolean |
verify(String hash,
char[] password) |
Check that a plaintext password matches a previously hashed one
|
public static final int DEFAULT_COST
public static String hash(char[] password, int cost)
password
- the plaintext passwordcost
- the computation cost (complexity increases at 2**cost
)public static boolean verify(String hash, char[] password)
password
- the plaintext password to verifyhash
- the previously-hashed password (a 60-character BCrypt hash string)Copyright © 2018. All rights reserved.