2017 © Pedro Peláez
 

library ethereum-address-validator

Validate etheruem address

image

psychob/ethereum-address-validator

Validate etheruem address

  • Friday, June 8, 2018
  • by psychob
  • Repository
  • 1 Watchers
  • 0 Stars
  • 230 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Ethereum Address Validator

(c) by Andrzej Budzanowski kontakt@andrzej.budzanowski.pl, (*1)

Maintainability Test Coverage Build Status, (*2)

License

MPL-2.0, (*3)

Brief

Class that verifies if Ethereum address is properly formatted and - optionaly - properly checksummed according to EIP-55., (*4)

Installation

Use composer:, (*5)

composer require psychob/ethereum-address-validator

Usage

<?php
    use \PsychoB\Ethereum\AddressValidator;

    // Addresses that have good format and checksum are considered valid
    AddressValidator::isValid('0xA477941c7AAD6536f175ef123bf9eeD6F82A4c85') === AddressValidator::ADDRESS_VALID;

    // Also addresses that are all uppercase or all lowercase are considered valid (no checksum check performed)
    AddressValidator::isValid('0xA477941C7AAD6536F175EF123BF9EED6F82A4C85') === AddressValidator::ADDRESS_VALID;
    AddressValidator::isValid('0xa477941c7aad6536f175ef123bf9eed6f82a4c85') === AddressValidator::ADDRESS_VALID;

    // Addresses that have good format but incorrect checksum
    AddressValidator::isValid('0xA477941c7aaD6536f175ef123bf9eeD6F82A4c85') === AddressValidator::ADDRESS_CHECKSUM_INVALID;

    // Address without proper format return
    AddressValidator::isValid('invalid address') === AddressValidator::ADDRESS_INVALID;

    // To get canonical (properly checksummed) addres, use:
    AddressValidator::getCanonicalAddress('0xA477941C7AAD6536F175EF123BF9EED6F82A4C85') === '0xA477941c7AAD6536f175ef123bf9eeD6F82A4c85'

The Versions

08/06 2018

dev-master

9999999-dev

Validate etheruem address

  Sources   Download

MPL-2.0

The Requires

 

The Development Requires

by Andrzej Budzanowski

08/06 2018

1.1

1.1.0.0

Validate etheruem address

  Sources   Download

MPL-2.0

The Requires

 

The Development Requires

by Andrzej Budzanowski

08/06 2018

1.0

1.0.0.0

Validate etheruem address

  Sources   Download

MPL-2.0

The Requires

 

The Development Requires

by Andrzej Budzanowski