Package org.trustdeck.algorithms
Class XxHashPseudonymizer
java.lang.Object
org.trustdeck.algorithms.Pseudonymizer
org.trustdeck.algorithms.XxHashPseudonymizer
This class provides a pseudonymization by assigning xxHash64-values as pseudonyms.
- Author:
- Armin Müller
-
Field Summary
Fields inherited from class org.trustdeck.algorithms.Pseudonymizer
DEFAULT_NUMBER_OF_RETRIES, DEFAULT_PADDING_CHAR, DEFAULT_VALUE_LENGTH, DOMAIN_FULL, PSEUDONYMIZATION_FAILED -
Constructor Summary
ConstructorsConstructorDescriptionBasic constructor.XxHashPseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName) A constructor that allows to set whether or not the created pseudonyms should be padded as well as the desired pseudonym value length and the character used for padding.XxHashPseudonymizer(boolean paddingWanted, Algorithm algorithm) Basic constructor.XxHashPseudonymizer(boolean paddingWanted, Domain domain) Basic constructor.XxHashPseudonymizer(String domainName) Basic constructor. -
Method Summary
Modifier and TypeMethodDescriptionpseudonymize(String identifier, String domainPrefix) Creates a xxHash64 hash pseudonym from the given identifier.Methods inherited from class org.trustdeck.algorithms.Pseudonymizer
addCheckDigit, addPadding, correctPseudonymLength, persist
-
Constructor Details
-
XxHashPseudonymizer
public XxHashPseudonymizer()Basic constructor. Padding is turned off. (The pseudonym value length is automatically set to the default, as well as the padding character.) -
XxHashPseudonymizer
Basic constructor. Padding is turned off. (The pseudonym value length is automatically set to the default, as well as the padding character.)- Parameters:
domainName- the name of the domain to which the record belongs to
-
XxHashPseudonymizer
public XxHashPseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName) A constructor that allows to set whether or not the created pseudonyms should be padded as well as the desired pseudonym value length and the character used for padding.- Parameters:
paddingWanted- whether or not the pseudonyms should be padded to a certain lengthpseudonymValueLength- the desired length of the pseudonym valuepaddingChar- the character that should be useddomainName- the name of the domain to which the record belongs to
-
XxHashPseudonymizer
Basic constructor. All necessary variables are directly retrieved from the domain object.- Parameters:
paddingWanted- whether or not the pseudonyms should be padded to a certain lengthdomain- the domain object
-
XxHashPseudonymizer
Basic constructor. All necessary variables are directly retrieved from the algorithm object.- Parameters:
paddingWanted- whether or not the pseudonyms should be padded to a certain lengthalgorithm- the algorithm object
-
-
Method Details
-
pseudonymize
Creates a xxHash64 hash pseudonym from the given identifier.- Specified by:
pseudonymizein classPseudonymizer- Parameters:
identifier- the value to be pseudonymizeddomainPrefix- the prefix for the domain- Returns:
- a pseudonym in the form of domainPrefix-pseudonymValue (e.g. TST-a1cd75fe29c449248cabfae)
-