litvinjuan/ethereum-validator

PHP implementation to validate ethereum addresses

1.0.0 2020-01-21 18:07 UTC

This package is auto-updated.

Last update: 2024-10-22 04:49:55 UTC


README

Ethereum Validator provides an easy way to validate a given string is a valid ethereum address.

Installation

You may install Ethereum Validator via Composer:

composer require litvinjuan/ethereum-validator

Usage

Ethereum Validator has a static isValidAddress method that receives a string containing the ethereum address and returns true if the address is valid, or false if it's not:

use litvinjuan\EthereumValidator\EthereumValidator;

$address = '0x71C7656EC7ab88b098defB751B7401B5f6d8976F';
if (EthereumValidator::isValidAddress($address)) {
    // Valid Address
}

// Invalid Address

Contributing

Thank you for considering contributing to Ethereum Validator! Please read the contributing guidelines before opening a PR.

##License

Ethereum Validator is open-sourced software licensed under the MIT license.