How to use the presidio-analyzer.analyzer.predefined_recognizers.iban_recognizer.IbanRecognizer function in presidio-analyzer

To help you get started, we’ve selected a few presidio-analyzer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / presidio / presidio-analyzer / analyzer / predefined_recognizers / iban_recognizer.py View on Github external
def validate_result(self, pattern_text):
        pattern_text = pattern_text.replace(' ', '')
        is_valid_checksum = (IbanRecognizer.__generate_iban_check_digits(
            pattern_text) == pattern_text[2:4])
        # score = EntityRecognizer.MIN_SCORE
        result = False
        if is_valid_checksum:
            if IbanRecognizer.__is_valid_format(pattern_text):
                result = True
            elif IbanRecognizer.__is_valid_format(pattern_text.upper()):
                result = None
        return result
github microsoft / presidio / presidio-analyzer / analyzer / predefined_recognizers / iban_recognizer.py View on Github external
def validate_result(self, pattern_text):
        pattern_text = pattern_text.replace(' ', '')
        is_valid_checksum = (IbanRecognizer.__generate_iban_check_digits(
            pattern_text) == pattern_text[2:4])
        # score = EntityRecognizer.MIN_SCORE
        result = False
        if is_valid_checksum:
            if IbanRecognizer.__is_valid_format(pattern_text):
                result = True
            elif IbanRecognizer.__is_valid_format(pattern_text.upper()):
                result = None
        return result
github microsoft / presidio / presidio-analyzer / analyzer / predefined_recognizers / iban_recognizer.py View on Github external
def __generate_iban_check_digits(iban):
        transformed_iban = (iban[:2] + '00' + iban[4:]).upper()
        number_iban = IbanRecognizer.__number_iban(transformed_iban)
        return '{:0>2}'.format(98 - (int(number_iban) % 97))

presidio-analyzer

Presidio Analyzer package

MIT
Latest version published 4 months ago

Package Health Score

94 / 100
Full package analysis

Similar packages