Package io.mangoo.utils
Class CodecUtils
java.lang.Object
io.mangoo.utils.CodecUtils
- Author:
- svenkubiak
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TdeserializeFromBase64(String data) Deserializes a given Base64 encoded data string into an objectstatic StringhashArgon2(String password, String salt) Hashes a given clear text password with salt using Argon2Id password hashingstatic StringHashes a given clear text data with SHA512 For simple hashing tasks UsehashArgon2for password hashingstatic booleanmatchArgon2(String password, String salt, String hashedPassword) Matches a given clear text password with salt using Argon2Id against an already Argon2Id hashed passwordstatic StringserializeToBase64(Serializable object) Serializes an object into a Base64 encoded data string
-
Method Details
-
hashArgon2
Hashes a given clear text password with salt using Argon2Id password hashing- Parameters:
password- The clear text passwordsalt- The salt- Returns:
- The hashed password
-
matchArgon2
Matches a given clear text password with salt using Argon2Id against an already Argon2Id hashed password- Parameters:
password- The clear text passwordsalt- The salthashedPassword- The already hashed password- Returns:
- True if hashes match, false otherwise
-
hexSHA512
Hashes a given clear text data with SHA512 For simple hashing tasks UsehashArgon2for password hashing- Parameters:
data- The clear text data- Returns:
- SHA512 hashed value
-
serializeToBase64
Serializes an object into a Base64 encoded data string- Parameters:
object- The object to serialize- Returns:
- The base64 encoded data string
-
deserializeFromBase64
Deserializes a given Base64 encoded data string into an object- Type Parameters:
T- Just for JavaDoc can be ignored- Parameters:
data- The base64 encoded data string- Returns:
- The required object
-