bdteo / php-stellar-strkey
A php implementation of Stellar Js SDK's "strkey"
Requires
- php: >=7.1.0
- composer-plugin-api: ^1.1
- christian-riesen/base32: ^1.1@dev
- pburggraf/crc: dev-master
Requires (Dev)
- psy/psysh: dev-master
This package is not auto-updated.
Last update: 2025-02-16 07:54:39 UTC
README
This repo is a 1:1 PHP implementation of the StrKey helper from the Stellar Js SDK
See it at: https://github.com/stellar/js-stellar-base/blob/master/src/strkey.js
composer require bdteo/php-stellar-strkey
According to the Stellar implementation: the 56 character base32 encoded string key can contain binary data of public key, private key, preAuthTx or a sha256Hash. ( Stellar uses Ed25519 public/private keys - https://ed25519.cr.yp.to/ )
You can use this class to validate Stellar addresses.
You can use this class also to check the validity of a Stellar string key, extract the payload data or encode payload data into a sting key.
Here is an example:
use Bdteo\Stellar\StrKey; $testAddress = 'GDDJ7IIWHZV4KWEX3QH437C3QZL4RTJCSXNVRAQMFESQP6WNZAM4N32Y'; $strKey = new StrKey(); $isValid = $strKey->isValidStellarAddress($testAddress); echo $isValid ? 'Awesome ! The address is valid !' : 'Too bad ! Your address is incorrect !';
Used on The TokenRush Airdrop Platform
I am planning to publish more general purpose crypto tools in the near future !