ognus / wallet-address-validator

Useful library for validation of Bitcoin, Litecoin, Ethereum and other cryptocoin addresses
MIT License
264 stars 128 forks source link

Dash Format Validator is invalid #51

Open dvsoo opened 5 years ago

dvsoo commented 5 years ago

Dash Format Validator is invalid And I hope make PIVX Format Validator Thank you

ljluestc commented 9 months ago
import re

def is_valid_pivx_address(address):
    # Regular expression pattern for a PIVX address
    pattern = r'^D[a-zA-Z0-9]{33}$'

    # Check if the address matches the pattern
    return re.match(pattern, address) is not None

# Test the validator
address1 = "D6fZq5sGQ5bJ5Rsz9K9u3L6p9n5YtZiPiK"
address2 = "invalid_address"

print(is_valid_pivx_address(address1))  # Should print True
print(is_valid_pivx_address(address2))  # Should print False