Skip to content

A .NET Core Library for converting Bencoded Dictionaries to Json Documents

License

Notifications You must be signed in to change notification settings

vijayshinva/Bencode2Json

Repository files navigation

Bencode2Json

A .NET Core Library for converting Bencoded Dictionaries to Json Documents

Build status CodeFactor NuGet version

Overview

Bencoded dictionaries like the one shown below can easily be coverted to JSON using this library.

Bencode
d5:debug4:truee
JSON
{
    "debug": "true"
}

Installation

Install the package Bencode2Json from NuGet or install it from the Package Manager Console:

PM> Install-Package Bencode2Json

Usage

using Bencode2Json;
...
...
// BencodedData takes any Stream
var bencodedData = new BencodedData(dataStream);
var json = bencodedData.ConvertToJson();

Examples

Demos in the Examples folder.

TorrentFileParser

This demo parses an torrent file (which is basically a bencoded dictionary) and converts it to JSON. This JSON is then passed to the popular JSON library JSON.NET for converting it into C# objects.

Reference

License

license FOSSA Status

FOSSA Status

About

A .NET Core Library for converting Bencoded Dictionaries to Json Documents

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages