Skip to content

Commit 2735d98

Browse files
committed
Add usage
1 parent 1d6ed1a commit 2735d98

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,23 @@ This yocLibrary enables your project to encode and decode Multibases in PHP.
1313

1414
## Use
1515

16-
TODO
16+
### Encoding
17+
18+
```php
19+
use YOCLIB\Multiformats\Multibase\Multibase;
20+
21+
$text = 'Hello world!';
22+
23+
$encodedString = Multibase::encode(Multibase::BASE16UPPER,$text);
24+
}
25+
```
26+
27+
### Decoding
28+
29+
```php
30+
use YOCLIB\Multiformats\Multibase\Multibase;
31+
32+
$encodedString = 'F48656C6C6F20776F726C6421';
33+
34+
$text = Multibase::decode($encodedString);
35+
```

0 commit comments

Comments
 (0)