2017 © Pedro PelĂĄez
 

library bitcoin-address-validator

A simple, easy to use PHP Bitcoin address validator

image

linusu/bitcoin-address-validator

A simple, easy to use PHP Bitcoin address validator

  • Wednesday, August 20, 2014
  • by LinusU
  • Repository
  • 10 Watchers
  • 37 Stars
  • 51,784 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 11 Forks
  • 2 Open issues
  • 4 Versions
  • 12 % Grown

The README.md

php-bitcoin-address-validator

A simple, easy to use PHP Bitcoin address validator, (*1)

Usage

Quick start:, (*2)

use \LinusU\Bitcoin\AddressValidator;

// This will return false, indicating invalid address.
AddressValidator::isValid('blah');

// This is a valid address and will thus return true.
AddressValidator::isValid('1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62i');

// This is a Testnet address, it's valid and the function will return true.
AddressValidator::isValid('mo9ncXisMeAoXwqcV5EWuyncbmCcQN4rVs', AddressValidator::TESTNET);

API

isValid($addr, $version)

  • $addr: A bitcoin address
  • $version: The version to test against, defaults to MAINNET

Returns a boolean indicating if the address is valid or not., (*3)

typeOf($addr)

  • $addr: A bitcoin address

Returns the type of the address., (*4)

Constants

The library exposes the following constants., (*5)

  • MAINNET: Indicates any mainnet address type
  • TESTNET: Indicates any testnet address type
  • MAINNET_PUBKEY: Indicates a mainnet pay to pubkey hash address
  • MAINNET_SCRIPT: Indicates a mainnet pay to script hash address
  • TESTNET_PUBKEY: Indicates a testnet pay to pubkey hash address
  • TESTNET_SCRIPT: Indicates a testnet pay to script hash address

The Versions

20/08 2014

dev-master

9999999-dev http://github.com/LinusU/bitcoin-address-validator

A simple, easy to use PHP Bitcoin address validator

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

validator validation address bitcoin

20/08 2014

v0.1.2

0.1.2.0 http://github.com/LinusU/bitcoin-address-validator

A simple, easy to use PHP Bitcoin address validator

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

validator validation address bitcoin

14/04 2014

v0.1.1

0.1.1.0 http://github.com/LinusU/bitcoin-address-validator

A simple, easy to use PHP Bitcoin address validator

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

validator validation address bitcoin

14/04 2014

v0.1.0

0.1.0.0 http://github.com/LinusU/bitcoin-address-validator

A simple, easy to use PHP Bitcoin address validator

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

validator validation address bitcoin