From 2785ddce1f50e4515298acbecba24b090508f820a6f752f576c668af9142ca42 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Mon, 16 Jun 2025 16:24:49 +0300 Subject: [PATCH] Trivial small conveniences --- spec/ComparisonWithOtherCodecs | 51 ---------------------------------- spec/INSTALL | 4 +-- spec/codecs | 10 +++++++ spec/comparison | 40 ++++++++++++++++++++++++++ spec/index | 2 +- spec/mk-html | 2 +- 6 files changed, 54 insertions(+), 55 deletions(-) delete mode 100644 spec/ComparisonWithOtherCodecs create mode 100644 spec/codecs create mode 100644 spec/comparison diff --git a/spec/ComparisonWithOtherCodecs b/spec/ComparisonWithOtherCodecs deleted file mode 100644 index 07a264a..0000000 --- a/spec/ComparisonWithOtherCodecs +++ /dev/null @@ -1,51 +0,0 @@ -Are not there any satisfiable codecs? - -=> https://en.wikipedia.org/wiki/Distinguished_Encoding_Rules#DER_encoding DER -=> https://en.wikipedia.org/wiki/Distinguished_Encoding_Rules#CER_encoding CER -=> https://datatracker.ietf.org/doc/html/rfc1014 XDR -=> https://www.JSON.org/json-en.html JSON -=> https://bsonspec.org/ BSON -=> https://msgpack.org/ MessagePack -=> https://datatracker.ietf.org/doc/html/rfc8949 CBOR -=> https://datatracker.ietf.org/doc/html/draft-mcnally-deterministic-cbor-11 dCBOR -=> http://cr.yp.to/proto/netstrings.txt Netstrings -=> https://wiki.theory.org/BitTorrentSpecification#Bencoding Bencode -=> https://en.wikipedia.org/wiki/Canonical_S-expressions Canonical S-expression - - | Schemaless | Simple | Deterministic | Streamable | Compact -ASN.1 DER | N | N | Y | N | N -ASN.1 CER | N | N | Y | Y | N -XDR | N | Y | N | N | N -JSON | Y | N | N | Y | N -BSON | Y | Y | N | N | N -MessagePack | Y | Y | N | N | Y -CBOR | Y | N | N | Y | Y -dCBOR | Y | N | Y | N | Y -Netstrings | Y | Y | Y | N | ~ -Bencode | Y | Y | Y | Y | ~ -CSExp | Y | Y | Y | Y | ~ -KEKS | Y | Y | Y | Y | Y - - | BigStr | BinStr | UTF8Str | Int | BigInt | List | Struct | Time -ASN.1 DER | Y | Y | Y | Y | Y | Y | Y | Y -ASN.1 CER | Y | Y | Y | Y | Y | Y | Y | Y -XDR | N | Y | Y | Y | N | Y | Y | N -JSON | Y | N | Y | Y | Y | Y | Y | N -BSON | N | Y | Y | Y | N | Y | Y | Y -MessagePack | N | Y | Y | Y | N | Y | Y | N -CBOR | Y | Y | Y | Y | N | Y | Y | N -dCBOR | Y | Y | Y | Y | N | Y | Y | N -Netstrings | Y | Y | N | N | N | N | N | N -Bencode | Y | Y | N | Y | Y | Y | Y | N -CSExp | Y | Y | N | N | N | Y | N | N -KEKS | Y | Y | Y | Y | Y | Y | Y | Y - -Note about CBOR: - -* Hardly you will find wide range of CBOR libraries supporting strict - validation of deterministically encoded CBOR structures. -* Tagged string/integer can not be taken as a viable first-class - bigint/datetime data support, because many decoders do not support - tags and won't be able to interpret/validate them. -* Non-string map keys very complicates representation process for - dynamically types languages. diff --git a/spec/INSTALL b/spec/INSTALL index 7c25dcd..6098c7e 100644 --- a/spec/INSTALL +++ b/spec/INSTALL @@ -1,5 +1,5 @@ -Currently there are draft versions of the codec written on C, Go, -Python and Tcl. +Currently there are draft versions of the codec written on +C99, Go, Python3 and Tcl. You can obtain development source code with: git clone git://git.cypherpunks.su/keks.git diff --git a/spec/codecs b/spec/codecs new file mode 100644 index 0000000..2feca8c --- /dev/null +++ b/spec/codecs @@ -0,0 +1,10 @@ +=> https://en.wikipedia.org/wiki/Distinguished_Encoding_Rules#DER_encoding DER +=> https://en.wikipedia.org/wiki/Distinguished_Encoding_Rules#CER_encoding CER +=> https://www.JSON.org/json-en.html JSON +=> https://bsonspec.org/ BSON +=> https://msgpack.org/ MessagePack +=> https://datatracker.ietf.org/doc/html/rfc8949 CBOR +=> https://datatracker.ietf.org/doc/html/draft-mcnally-deterministic-cbor-11 dCBOR +=> http://cr.yp.to/proto/netstrings.txt Netstrings +=> https://wiki.theory.org/BitTorrentSpecification#Bencoding Bencode +=> https://en.wikipedia.org/wiki/Canonical_S-expressions Canonical S-expressions diff --git a/spec/comparison b/spec/comparison new file mode 100644 index 0000000..2c4295d --- /dev/null +++ b/spec/comparison @@ -0,0 +1,40 @@ +Are not there any satisfiable [codecs]? + + | simple | deterministic | streamable | compact +------------+--------+---------------+------------+-------- +ASN.1 DER | N | Y | N | N +ASN.1 CER | N | Y | Y | N +JSON | N | N | Y | N +BSON | Y | N | N | N +MessagePack | Y | N | N | Y +CBOR | N | N | Y | Y +dCBOR | N | Y | N | Y +Netstrings | Y | Y | N | ~ +Bencode | Y | Y | Y | ~ +CSExp | Y | Y | Y | ~ +KEKS | Y | Y | Y | Y + + | big | bin | UTF | | big | | | + | str | str | str | int | int | list | map | time +------------+-----+-----+-----+-----+-----+------+-----+----- +ASN.1 DER | Y | Y | Y | Y | Y | Y | Y | Y +ASN.1 CER | Y | Y | Y | Y | Y | Y | Y | Y +JSON | Y | N | Y | Y | Y | Y | Y | N +BSON | N | Y | Y | Y | N | Y | Y | Y +MessagePack | N | Y | Y | Y | N | Y | Y | N +CBOR | Y | Y | Y | Y | N | Y | Y | N +dCBOR | Y | Y | Y | Y | N | Y | Y | N +Netstrings | Y | Y | N | N | N | N | N | N +Bencode | Y | Y | N | Y | Y | Y | Y | N +CSExp | Y | Y | N | N | N | Y | N | N +KEKS | Y | Y | Y | Y | Y | Y | Y | Y + +Note about CBOR: + +* Hardly you will find wide range of CBOR libraries supporting strict + validation of deterministically encoded CBOR structures. +* Tagged string/integer can not be taken as a viable first-class + bigint/datetime data support, because many decoders do not support + tags and won't be able to interpret/validate them. +* Non-string map keys very complicates representation process for + dynamically types languages. diff --git a/spec/index b/spec/index index 985681e..d062f94 100644 --- a/spec/index +++ b/spec/index @@ -27,7 +27,7 @@ requirements below. * It *should* differentiate binary and human-readable strings. * It *would* be nice to have human-editable intermediate representation. -<<[ComparisonWithOtherCodecs] +<<[comparison] [INSTALL] [encoding/] diff --git a/spec/mk-html b/spec/mk-html index e0498e9..6b8bfbd 100755 --- a/spec/mk-html +++ b/spec/mk-html @@ -2,7 +2,7 @@ # git://git.stargrave.org/swg.git is used html=spec.html -SWG_DO_BACKS=0 swg htmls $html +SWG_DO_BACKS=0 SWG_DO_SRC=0 swg htmls $html perl -i -npe 's#^.*$#<title>KEKS#' $html/index.html find $html -type d -exec chmod 755 {} + find $html -type f -exec chmod 644 {} + -- 2.50.0