caikit.core.toolkit.reversible_hasher

The ReversibleHasher provides a simple obfuscation tool for munging strings in a reversible way. It is useful when needing a repeatable way to obfuscate a string that may come from a configuration detail that should not be transparently visible to a user, but needs to be trivially reversed, possibly with entirely new in-memory state.

WARNING: This utility is intentionally not a cryptographically secure hash! It

is explicitly designed to be reversible.

Attributes

_RAND_INST

_CHARSET

_SHUFFLED

FORWARD_MAP

BACKWARD_MAP

Classes

ReversibleHasher

Module Contents

caikit.core.toolkit.reversible_hasher._RAND_INST
caikit.core.toolkit.reversible_hasher._CHARSET = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_'
caikit.core.toolkit.reversible_hasher._SHUFFLED = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',...
caikit.core.toolkit.reversible_hasher.FORWARD_MAP
caikit.core.toolkit.reversible_hasher.BACKWARD_MAP
class caikit.core.toolkit.reversible_hasher.ReversibleHasher[source]
__doc__ = Multiline-String
Show Value
"""The ReversibleHasher provides a simple obfuscation tool for munging strings
in a reversible way. It is useful when needing a repeatable way to obfuscate a
string that may come from a configuration detail that should not be
transparently visible to a user, but needs to be trivially reversed, possibly
with entirely new in-memory state.

WARNING: This utility is intentionally not a cryptographically secure hash! It
    is explicitly designed to be reversible.
"""
classmethod hash(val: str)[source]
classmethod reverse_hash(hash_val: str)[source]