package bencode

  1. Overview
  2. Docs
Bencode (`.torrent` file format) reader/writer in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

2.0.tar.gz
md5=80a4d59a246c31df45a42779c777bb28
sha512=687544db98ca47ecd55c8235e751b04df58fd5aba1270dcc93e19629f483f33232ac3779c0e07d0fdb67ea958156113143b0bd3b8640478928b591092d327d12

Description

Published: 11 Dec 2019

README

bencode

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

Dependencies (2)

  1. ocaml >= "4.02.0"
  2. dune

Dev Dependencies (3)

  1. odoc with-doc
  2. qcheck with-test & >= "0.5.3"
  3. ounit with-test

Used by (2)

  1. decoders-bencode >= "0.4.0"
  2. maki

Conflicts

None

OCaml

Innovation. Community. Security.