Module validation

Source
Expand description

CRC16 validation and other validation utilities for PIX BR Code

Constants§

CRC16
CRC16 calculator for EMV QRCPS compliance (CRC-16/CCITT-FALSE) Using the standard CRC-16 polynomial 0x1021 with initial value 0xFFFF

Functions§

calculate_crc16
Calculate CRC16 checksum for a BR Code payload
validate_country_code
Validate country code (should be “BR”)
validate_crc16
Validate CRC16 checksum of a BR Code string
validate_currency
Validate currency code (should be “986” for BRL)
validate_gui
Validate GUI field (should be “br.gov.bcb.pix”)
validate_merchant_city
Validate merchant city format
validate_merchant_name
Validate merchant name format
validate_payload_format
Validate payload format indicator (should be “01”)
validate_pix_key
Validate PIX key format
validate_transaction_amount
Validate transaction amount format