Skip to content

Commit

Permalink
Update Converter.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Beakerboy authored Jul 16, 2019
1 parent 2176e7a commit 830de3b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ public static function toLegacy(string $address, bool $wif = true): string
*/
public static function toCashaddr(string $address): string
{
/**
$addr = new ArbitraryInteger($address, 58, self::ALPHABET);
$base16 = str_pad($addr->toBase(16, ArbitraryInteger::RFC3548_BASE16), 50, "0", STR_PAD_LEFT);
$base16 = substr($base16, 2, -8);
$base32 = new ArbitraryInteger($base16, 16, ArbitraryInteger::RFC3548_BASE16);
$base32->leftShift(2)->toBase(32, self::CHARSET);
*/
// check if legacy format
$len = strlen($address);

Expand Down

0 comments on commit 830de3b

Please sign in to comment.