]> Cypherpunks repositories - keks.git/commitdiff
tcl/keks.tcl compatible notation
authorSergey Matveev <stargrave@stargrave.org>
Tue, 13 May 2025 10:08:08 +0000 (13:08 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 13 May 2025 10:08:08 +0000 (13:08 +0300)
spec/encoding/BLOB
spec/encoding/LIST
spec/encoding/MAGIC
spec/encoding/MAP

index 80bdfe395710a143392e2916dc01e574c02f6d675f51e2b12a6250c179768218..e7eb48dda02fce37f5a8e70928d1bb00fbcc390d282577b6b65717292ae89dee 100644 (file)
@@ -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
index 259df195261aba6a7e4bc260f4579b47309792268058eeafb19032cde3b61a4d..84515480bd38ea5104ec7d1e550815bafda2d53d4a4e3682a96634941ec1e03c 100644 (file)
@@ -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
index 53f55d96b3fb2f2cbb094c7b06868345113204f8bdce206a864776796f3c7136..a59e4fcde066056d647db7f12452ab98c3ed920812e39c64da146fcfb9a8e7a3 100644 (file)
@@ -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
index 1f6e5a01bb66d5bea6cf075551fdedd394f9f468d3852f6396ce0bce5067933a..6b45ab8a51be1683bfd27e0e0ebfd4ab36c7f0643b7c4a65bd74a585fee04b8e 100644 (file)
@@ -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