Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jrabausch committed Nov 10, 2022
1 parent ac408d9 commit 592570e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ composer require semperton/multibase
```
Multibase requires PHP 7.4+ and the mbstring extension

> Tip: Install the GMP extension for faster base conversion
## Package
Included base transcoders:
- Base58
Expand Down Expand Up @@ -56,13 +58,13 @@ You can create custom transcoders with your own alphabets (multibyte support).
Just for fun, how about an emoji transcoder?

```php
use Semperton\Multibase\Transcoder;
use Semperton\Multibase\Transcoder\BaseTranscoder;

$emojiTranscoder = new Transcoder(
$emojiTranscoder = new BaseTranscoder(
'🧳🌂☂️🧵🪡🪢🧶👓🕶🥽🥼🦺👔👕👖🧣🧤🧥🧦👗👘🥻🩴🩱🩲' .
'🩳👙👚👛👜👝🎒👞👟🥾🥿👠👡🩰👢👑👒🎩🎓🧢⛑🪖💄💍💼'
);

$encoded = $transcoder->encode('Hello World'); // ☂🪢👟🩴🩰🥻👚👙🧢🩲🧥🥽🎩👙👝🎒
$transcoder->decode($encoded); // Hello World
$encoded = $emojiTranscoder->encode('Hello World'); // ☂🪢👟🩴🩰🥻👚👙🧢🩲🧥🥽🎩👙👝🎒
$emojiTranscoder->decode($encoded); // Hello World
```

0 comments on commit 592570e

Please sign in to comment.