Skip to content

cfcs/bencode

 
 

Repository files navigation

bencode Build Status

Bencode (.torrent file format) reader/writer in OCaml without any external dependencies.

See lib/bencode.mli. Usage is straightforward. There is also a streaming API in modules Bencode_streaming and Bencode_token.

Installation

For a findlib based install

make
make install

Example

In the top level:

#require "bencode"
Bencode.decode (`File_path "test.torrent")

Will return a data structure representing the bencoded form of the following type:

type t =
  | Integer of int
  | String of string
  | List of t list
  | Dict of (string * t) list

About

Bencode (.torrent file format) reader/writer in OCaml

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 97.0%
  • Makefile 3.0%