mattvb91 /
tron-trx-php
| 1 | <?php |
||
| 2 | |||
| 3 | namespace mattvb91\TronTrx\Support; |
||
| 4 | |||
| 5 | /** |
||
| 6 | * @codeCoverageIgnore |
||
| 7 | */ |
||
| 8 | class Base58 |
||
| 9 | { |
||
| 10 | const AVAILABLE_CHARS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; |
||
| 11 | |||
| 12 | public static function encode($num, $length = 58): string |
||
| 13 | { |
||
| 14 | return Crypto::dec2base($num, $length, self::AVAILABLE_CHARS); |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 15 | } |
||
| 16 | |||
| 17 | public static function decode(string $addr, int $length = 58): string |
||
| 18 | { |
||
| 19 | return Crypto::base2dec($addr, $length, self::AVAILABLE_CHARS); |
||
|
0 ignored issues
–
show
|
|||
| 20 | } |
||
| 21 | } |
||
| 22 |