main_15.py 379 B

123456
  1. def _pseudonymize_value(self, value: str, pseudonyms: list[dict]) -> str:
  2. hash_string = self._hasher.hash_str(value, salt=self._config.hash_salt)
  3. if self._cache.requires_storing(hash_string):
  4. encrypted_origin = self._encrypter.encrypt(value)
  5. pseudonyms.append({"pseudonym": hash_string, "origin": encrypted_origin})
  6. return self._wrap_hash(hash_string)