]> Cypherpunks.ru repositories - netstring.git/blob - README
ea30c6314ae2f69b9ba3587548ef2e1285b7b236
[netstring.git] / README
1 netstring format serialization library in pure Go.
2
3 Netstring is very simple binary strings serialization format. For
4 example "hello world!" will be encoded as "12:hello world!,". And an
5 empty string is encoded as "0:,".
6 Read more at: http://cr.yp.to/proto/netstrings.txt
7
8 That library contains an example utility to deal with concatenated
9 netstring in single file:
10
11     $ go get go.cypherpunks.ru/netstring/cmd/netstring
12     $ ls in[123]
13     -rw------- 3490 in1
14     -rw------- 1363 in2
15     -rw------- 2003 in3
16     $ netstring write in1 in2 in3 > out
17     0       3490    in1
18     1       1363    in2
19     2       2003    in3
20     $ netstring list out
21     0       3490
22     1       1363
23     2       2003
24     $ sha256 in[123]
25     SHA256 (in1) = 3197893dc2c58d9e8853e253e68a123ad0400f0c3670ae46ce5a8ff1dfe2149f
26     SHA256 (in2) = 293d09cbd7f2e5237627440b88d2e1238818521b208922aa54079d2c13974891
27     SHA256 (in3) = 65333ba0c9f974ff7f46114a18d8f4f176734cf21a704b4a318c6416d41da0ea
28     $ netstring read out 0 | sha256
29     3197893dc2c58d9e8853e253e68a123ad0400f0c3670ae46ce5a8ff1dfe2149f
30     $ netstring read out 1 | sha256
31     293d09cbd7f2e5237627440b88d2e1238818521b208922aa54079d2c13974891
32     $ netstring read out 2 | sha256
33     65333ba0c9f974ff7f46114a18d8f4f176734cf21a704b4a318c6416d41da0ea
34
35 netstring is free software: see the file COPYING for copying conditions.