summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-05-19 18:41:16 +0400
committerSam T <pxqr.sta@gmail.com>2013-05-19 18:41:16 +0400
commite4f66dc70959c64fb3b3ce7ef2b5da366062b980 (patch)
treed076b9aeb8b999b4475ac9067f8f4f2684e7b132
parentfbbd7adbb7e8672adb2ebef01342b15ab2835d8b (diff)
+ Complete readme.
-rw-r--r--README.md44
1 files changed, 40 insertions, 4 deletions
diff --git a/README.md b/README.md
index 7983303..c7976fc 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,53 @@
1# Synopsis 1# Synopsis
2 2
3Just a [faster][1] BEncode package. 3BEncode is JSON-like format used in bittorrent protocol but might be
4used anywhere else.
4 5
5# Description 6# Description
6 7
7Bencode (pronounced like B encode) is the encoding used by the peer-to-peer 8This package implements fast seamless encoding/decoding to/from
8file sharing system BitTorrent for storing and transmitting loosely structured data. 9bencode format for many native datatypes. To achive
9See full documentation at ```src/Data/BEncode.hs```. 10[more performance][1] we use new bytestring builders and hand
11optimized attoparsec parser so this library is considered as
12replacement for BEncode and AttoBencode packages.
13
14## Format
15
16Bencode is pretty similar to JSON: it has dictionaries(JSON objects),
17lists(JSON arrays), strings and integers. However bencode has a few
18advantages:
19
20* No spaces in between any values — nor lists nor dicts nor anywhere else.
21* Dictionaries always sorted lexicographically by the keys. This allow
22 us to test data on equality without decoding from raw bytestring.
23 Moreover this allow to hash encoded data (this property is heavily
24 used by core bittorrent protocol).
25* All strings prefixed with its length. This simplifies and speed up
26 string parsing.
27
28
29As always, each advantage has its disadvantage:
30
31* Bencode is certainly less human readable than JSON.
32* Bencode is rarely used. Except bittorrent protocol of course. But
33 this might be not a problem if you are searching for format for
34 internal use only.
35
36
37# Documentation
38
39For documentation see haddock generated documentation.
10 40
11# Build Status 41# Build Status
12 42
13[![Build Status][2]][3] 43[![Build Status][2]][3]
14 44
45# Authors
46
47This library is written and maintained by Sam T. <pxqr.sta@gmail.com>
48Feel free to report bugs and suggestions via github issue tracker or the mail.
49
50
15[1]: http://htmlpreview.github.com/?https://github.com/pxqr/bencoding/master/bench/comparison.html 51[1]: http://htmlpreview.github.com/?https://github.com/pxqr/bencoding/master/bench/comparison.html
16[2]: https://travis-ci.org/pxqr/bencoding.png 52[2]: https://travis-ci.org/pxqr/bencoding.png
17[3]: https://travis-ci.org/pxqr/bencoding 53[3]: https://travis-ci.org/pxqr/bencoding