Package org.trustdeck.algorithms
Class RandomAlphabetPseudonymizer
java.lang.Object
org.trustdeck.algorithms.Pseudonymizer
org.trustdeck.algorithms.RandomAlphabetPseudonymizer
This class provides a pseudonymization by assigning random letters 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
ConstructorsConstructorDescriptionRandomAlphabetPseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName, int numberOfRetries, String alphabet) 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.RandomAlphabetPseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName, String alphabet) 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.RandomAlphabetPseudonymizer(boolean paddingWanted, Algorithm algorithm) Basic constructor.RandomAlphabetPseudonymizer(boolean paddingWanted, Domain domain) Basic constructor.RandomAlphabetPseudonymizer(String alphabet) Basic constructor.RandomAlphabetPseudonymizer(String domainName, String alphabet) Basic constructor. -
Method Summary
Modifier and TypeMethodDescriptionpseudonymize(String identifier, String domainPrefix) Creates a random character pseudonym for the given identifier.Methods inherited from class org.trustdeck.algorithms.Pseudonymizer
addCheckDigit, addPadding, correctPseudonymLength, persist
-
Constructor Details
-
RandomAlphabetPseudonymizer
Basic constructor. Padding is turned off. (The pseudonym value length is automatically set to the default, as well as the padding character.) -
RandomAlphabetPseudonymizer
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
-
RandomAlphabetPseudonymizer
public RandomAlphabetPseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName, String alphabet) 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
-
RandomAlphabetPseudonymizer
public RandomAlphabetPseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName, int numberOfRetries, String alphabet) 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 tonumberOfRetries- the number of times the method retries finding a random number that is not already in use
-
RandomAlphabetPseudonymizer
Basic constructor. Number of retries is set to default, all other 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
-
RandomAlphabetPseudonymizer
Basic constructor. Number of retries is set to default, all other 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 random character pseudonym for the given identifier. The identifier is not actively used in this method.- 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)
-