Skip to content

sha256

sha256

Classes:

Name Description
SHA256

SHA256 regex pattern matcher. Will match any length 64 hex string in

SHA256()

Bases: RegexPredictor

SHA256 regex pattern matcher. Will match any length 64 hex string in isolation (not embedded in a longer string), regardless of label or lack thereof.

Examples:

{"foo": "f63e93baeb60ca18fdc9a81e9358417df63e93baeb60ca18fdc9a81e9358417d"} "f63e93baeb60ca18fdc9a81e9358417df63e93baeb60ca18fdc9a81e9358417d"

Counterexamples

{"bar": "baz f63e93baeb60ca18fdc9a81e9358417df63e93baeb60ca18fdc9a81e9358417d"}

Source code in src/nemo_safe_synthesizer/pii_replacer/ner/regexes/sha256.py
def __init__(self):
    patterns = [Pattern(pattern=SHA256_REGEX, raw_score=Score.HIGH)]

    super().__init__(entity=Entity.SHA256, patterns=patterns)