Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/synodriver/lua-bencode
lua bencode library, written in C
https://github.com/synodriver/lua-bencode
Last synced: 20 days ago
JSON representation
lua bencode library, written in C
- Host: GitHub
- URL: https://github.com/synodriver/lua-bencode
- Owner: synodriver
- Created: 2024-10-19T14:24:35.000Z (26 days ago)
- Default Branch: main
- Last Pushed: 2024-10-21T13:30:17.000Z (24 days ago)
- Last Synced: 2024-10-22T03:11:59.608Z (24 days ago)
- Language: C
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
✨ lua-bencode ✨
The C extension of bencode
```lua
local bencode = require("bencode")print(bencode.loads("i1233e"))
print(bencode.loads("i-1233e"))
print(bencode.loads("6:string"))
print("---------")
for k,v in pairs(bencode.loads("d3:age9:Ein Verne9:interestsi18e4:namel4:book5:movieee")) do
print(k, v)
if type(v) == "table" then
for k1, v1 in pairs(v) do
print(" ", k1, v1)
end
end
end
print("---------")
for k,v in pairs(bencode.loads("l7:contenti42ee")) do
print(k, v)
end
print(pcall(bencode.loads, "i00e"))print(bencode.dumps({1,2,3, "3141"}))
print(bencode.dumps({["123"]="ddsaf", ["1243"]=12}, 100000))
```