Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rapougnac/eterl
Eterl is a fast packer and unpacker for the External Term Erlang Format (version 131).
https://github.com/rapougnac/eterl
encoder-decoder erlang
Last synced: 3 months ago
JSON representation
Eterl is a fast packer and unpacker for the External Term Erlang Format (version 131).
- Host: GitHub
- URL: https://github.com/rapougnac/eterl
- Owner: Rapougnac
- License: apache-2.0
- Created: 2023-01-11T10:01:19.000Z (about 2 years ago)
- Default Branch: mistress
- Last Pushed: 2024-05-28T14:06:19.000Z (8 months ago)
- Last Synced: 2024-05-29T04:17:42.314Z (8 months ago)
- Topics: encoder-decoder, erlang
- Language: Dart
- Homepage:
- Size: 40 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Eterl (External Term Erlang (format))
Eterl is a fast packer and unpacker for the External Term Erlang Format (version 131).
## Example
```dart
import 'package:eterl/eterl.dart';void main() {
final data = [{'hello': ['eterl', 1,2,3], 'l': [{'im': 'nested', 'i': {'also': 'supports unicode 💀🗿🥀 èè¨àà¨ü!ääüäöä£üüöäüéèéè>>>><<<<>>~~~'}}]}];
final packed = eterl.pack(data);
final unpacked = eterl.unpack(packed);
print(unpacked);
}
```## Supported terms
- `String`s
- `Atom`s (only while decoding)
- `bool`s
- `double`s
- `int`s
- `BigInt`s
- `Map`s
- `List`s
- `Tuple`s (only while decoding, tuples are converted into a `List`)## Benchmarks
`dart run benchmark/eterl_benchmark.dart`
```shell
[210ms:142us] Encoder: hello world
mean: 0.15 ± 0.11 us, median: 0.13 ± 0.017 us
▉▂▄▂__________ 110 _____ sample size: 100 (averaged over 225 runs)[243ms:186us] Encoder: data
mean: 2.59 ± 0.76 us, median: 2.28 ± 0.24 us
▆▉▄▂________________▁_______ sample size: 79 (averaged over 199 runs)[274ms:047us] Encoder: Complex data
mean: 49.75 ± 12.45 us, median: 42.58 ± 14.93 us
▉▁▁▁_ sample size: 28 (averaged over 46 runs)[206ms:551us] Decoder: hello world
mean: 0.23 ± 0.12 us, median: 0.17 ± 0.10 us
▉_▄▁_____________ sample size: 100 (averaged over 188 runs)[243ms:790us] Decoder: data
mean: 3.60 ± 1.17 us, median: 2.91 ± 1.46 us
▉▆▁▁▃_ sample size: 75 (averaged over 165 runs)[266ms:378us] Decoder: Complex data
mean: 158.66 ± 312.078 us, median: 63.87 ± 12.28 us
▉▅▁_▁____ 149 _____ sample size: 27 (averaged over 28 runs)
```