From: Sergey Matveev Date: Tue, 13 May 2025 10:08:08 +0000 (+0300) Subject: tcl/keks.tcl compatible notation X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ef3078a7d916c469789801c3d38e03039a37ecc9d233f3bcbe9bf4a46117b46b;p=keks.git tcl/keks.tcl compatible notation --- diff --git a/spec/encoding/BLOB b/spec/encoding/BLOB index 80bdfe3..e7eb48d 100644 --- a/spec/encoding/BLOB +++ b/spec/encoding/BLOB @@ -14,8 +14,8 @@ used, if it needs deterministic encoding. Example representations: -BLOB(5, "") | 0B 0000000000000004 80 -BLOB(5, "12345") | 0B 0000000000000004 85 3132333435 80 -BLOB(5, "123456") | 0B 0000000000000004 85 3132333435 81 36 -BLOB(500, "123") | 0B 00000000000001F3 83 313233 -BLOB(2, "12345") | 0B 0000000000000001 82 3132 82 3334 81 35 +BLOB {5 ""} | 0B 0000000000000004 80 +BLOB {5 "12345"} | 0B 0000000000000004 85 3132333435 80 +BLOB {5 "123456"} | 0B 0000000000000004 85 3132333435 81 36 +BLOB {500 "123"} | 0B 00000000000001F3 83 313233 +BLOB {2 "12345"} | 0B 0000000000000001 82 3132 82 3334 81 35 diff --git a/spec/encoding/LIST b/spec/encoding/LIST index 259df19..8451548 100644 --- a/spec/encoding/LIST +++ b/spec/encoding/LIST @@ -5,5 +5,5 @@ EOC atom. Example representations: -LIST[] | 08 00 -LIST[INT(123) FALSE] | 08 0C817B 02 00 +LIST {} | 08 00 +LIST {{INT 123} FALSE} | 08 0C817B 02 00 diff --git a/spec/encoding/MAGIC b/spec/encoding/MAGIC index 53f55d9..a59e4fc 100644 --- a/spec/encoding/MAGIC +++ b/spec/encoding/MAGIC @@ -7,6 +7,6 @@ It is intended to be prepended to the KEKS-encoded data in files. Example representations: -MAGIC(cm/pub) | 4B454B53 636D2F707562 000000000000 -MAGIC(cm/signed) | 4B454B53 636D2F7369676E6564 000000 -MAGIC(cm/encrypted) | 4B454B53 636D2F656E63727970746564 +MAGIC cm/pub | 4B454B53 636D2F707562 000000000000 +MAGIC cm/signed | 4B454B53 636D2F7369676E6564 000000 +MAGIC cm/encrypted | 4B454B53 636D2F656E63727970746564 diff --git a/spec/encoding/MAP b/spec/encoding/MAP index 1f6e5a0..6b45ab8 100644 --- a/spec/encoding/MAP +++ b/spec/encoding/MAP @@ -1,7 +1,7 @@ MAP contains concatenation of string(key)-value pairs. Keys *must* be non-empty, unique and length-first bytewise ascending ordered. - MAP [STR(KEY0) || ITEM0 || STR(KEY1) || ITEM1 || ... ] EOC + MAP [STR(KEY0) || ITEM0 || STR(KEY1) || ITEM1 || ...] EOC Hint: Encoding code for known format can be ordered itself to emit values in an already properly sorted way. @@ -11,5 +11,5 @@ overhead for each element, but reuses already existing code. Example representations: -MAP[foo: LIST["bar"]] | 09 C3666F6F 08 C3626172 00 00 -SET[sig, dh] | 09 C26468 01 C3736967 01 00 +MAP {foo {LIST {{STR "bar"}}}} | 09 C3666F6F 08 C3626172 00 00 +SET {sig dh} | 09 C26468 01 C3736967 01 00