public class HashKit extends Object
Modifier and Type | Field and Description |
---|---|
static long |
FNV_OFFSET_BASIS_64 |
static long |
FNV_PRIME_64 |
Constructor and Description |
---|
HashKit() |
Modifier and Type | Method and Description |
---|---|
static long |
fnv1a64(String key) |
static String |
generateSalt(int saltLength)
md5 128bit 16bytes
sha1 160bit 20bytes
sha256 256bit 32bytes
sha384 384bit 48bytes
sha512 512bit 64bytes
|
static String |
generateSaltForSha256() |
static String |
generateSaltForSha512() |
static String |
hash(String algorithm,
String srcStr) |
static String |
md5(String srcStr) |
static String |
sha1(String srcStr) |
static String |
sha256(String srcStr) |
static String |
sha384(String srcStr) |
static String |
sha512(String srcStr) |
static boolean |
slowEquals(byte[] a,
byte[] b) |
static String |
toHex(byte[] bytes) |
public static final long FNV_OFFSET_BASIS_64
public static final long FNV_PRIME_64
public static long fnv1a64(String key)
public static String toHex(byte[] bytes)
public static String generateSalt(int saltLength)
public static String generateSaltForSha256()
public static String generateSaltForSha512()
public static boolean slowEquals(byte[] a, byte[] b)
Copyright © 2018. All rights reserved.