public class HashingAlgorithms extends Object
HashingAlgorithmBuilder.build()
to retrieve immutable HashingAlgorithm instance.| Constructor and Description |
|---|
HashingAlgorithms() |
| Modifier and Type | Method and Description |
|---|---|
static HashingAlgorithmBuilder |
md5()
Creates a new builder for MD5 hashing algorithm.
|
static HashingAlgorithmBuilder |
sha1()
Creates a new builder for SHA-1 hashing algorithm.
|
static HashingAlgorithmBuilder |
sha256()
Creates a new builder for SHA-256 hashing algorithm.
|
static HashingAlgorithmBuilder |
sha512()
Creates a new builder for SHA-512 hashing algorithm.
|
public static HashingAlgorithmBuilder md5()
More than 10 years, it is NOT recommended to use this algorithm. If you can choose, go with some stronger function (e.g. SHA-256 or SHA-512).
public static HashingAlgorithmBuilder sha1()
This algorithm is stronger than MD5 but it has also its weaknesses. If you can choose, go with some stronger function (e.g. SHA-256 or SHA-512).
public static HashingAlgorithmBuilder sha256()
This algorithm should be sufficient for many cases (e.g. password hashing). If slightly higher execution time is not an issue for you, you can also use stronger SHA-512.
public static HashingAlgorithmBuilder sha512()
This algorithm should be sufficient for many cases (e.g. password hashing). If you need slightly lower execution time, you can also use SHA-256.
Copyright © 2019. All rights reserved.