https://github.com/ire4ever1190/bencodie
Bencoder library for Nim
https://github.com/ire4ever1190/bencodie
Last synced: 3 months ago
JSON representation
Bencoder library for Nim
- Host: GitHub
- URL: https://github.com/ire4ever1190/bencodie
- Owner: ire4ever1190
- Created: 2023-06-21T02:42:22.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-07T05:01:49.000Z (almost 2 years ago)
- Last Synced: 2025-02-07T17:45:59.657Z (8 months ago)
- Language: Nim
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Bencodie
[docs here](https://ire4ever1190.github.io/bencodie/bencodie.html)
Simple bencoder library. Made since I needed to read some bencoded text but the other libraries either didn't work or didn't do what I want.
This maps to/from `JsonNode` so that you can easily convert your objects to/from bencoding.
```nim
# This is basically the entire API
assert readBencode("li14e4:spamli42eee") == %*[14, "spam", [42]]
assert writeBencode(%14) == "i14e"
```