Class AddressValidationHelper
java.lang.Object
org.deltava.security.AddressValidationHelper
A helper class to calculate hash code values for e-mail address validation.
- Since:
- 1.0
- Version:
- 7.0
- Author:
- Luke
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
calculateCRC32
(String addr) Calculates the validate hash code for an e-mail address using CRC32, converted to hexadecimal.static String
calculateHashCode
(String addr) Calculates the validate hash code for an e-mail address, converted to Base64.static String
formatHash
(CharSequence rawHash) Restores a submitted hashcode even after IE has converted the plus signs to spaces.
-
Method Details
-
calculateHashCode
Calculates the validate hash code for an e-mail address, converted to Base64.- Parameters:
addr
- the e-mail address- Returns:
- the hash code
- Throws:
NullPointerException
- if addr is null
-
calculateCRC32
Calculates the validate hash code for an e-mail address using CRC32, converted to hexadecimal.- Parameters:
addr
- the e-mail address- Returns:
- the hash code
- Throws:
NullPointerException
- if addr is null
-
formatHash
Restores a submitted hashcode even after IE has converted the plus signs to spaces.- Parameters:
rawHash
- the raw hash code- Returns:
- the restored hash code with spaces converted to plus signs
-