X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=contrib%2Ffile_stack%2Fformat.txt;h=058b5b879a9e72436ec6b83ebfd6396d555d87ae;hp=12c18863616f06dc042ca5a6c6b89c48dedf5dd5;hb=276a54f13460010f0a5866466820c101ee08cbe6;hpb=801ade78e61ac7771ada1268a3bb5e6e5c1326ff;ds=sidebyside diff --git a/contrib/file_stack/format.txt b/contrib/file_stack/format.txt index 12c18863..058b5b87 100644 --- a/contrib/file_stack/format.txt +++ b/contrib/file_stack/format.txt @@ -1,20 +1,34 @@ A file-based stack: =================== -This is the format for a file-based stack which works as any Stackable class. +This is the format for a file-based stack which works as any other Stackable +class. General made up: -Purpose: | "magic" | separator | count | position | separator | ----------+-----------+-----------+----------+---------------+-----------+ -Bytes: | 9 | 1 | 20 (hex) | 2 - n^2 (hex) | 1 | ----------+-----------+-----------+----------+---------------+-----------+ -Example: | STACKv1.0 | ??? | 0...ff | 01 | ??? | +Purpose: | "magic" | separator | count | separator | position | separator | +---------+-----------+-----------+----------+-----------+------0---+-----------+ +Bytes: | 9 | 1 | 20 (hex) | 1 | 20 (hex) | 1 | +---------+-----------+-----------+----------+-----------+----------+-----------+ +Example: | STACKv1.0 | 01 | 00...ff | 01 | 00...ff | 02 | Continued: -Purpose: | name 0 | entry 0 | separator | name 1 | entry 1 | separator | name n | entry n | EOF | ----------+--------+------------+-----------+--------+------------+-----------+--------+------------+-----+ -Bytes: | 10 | 1-n (pack) | 1 | 10 | 1-n (pack) | 1 | 10 | 1-n (pack) | 1 | ----------+--------+------------+-----------+--------+------------+-----------+--------+------------+-----+ -Example: | foo | ... | ??? | bar | ... | ??? | bar | ... | EOF | +Purpose: | hash 0 | separator | name 0 | entry 0 | hash n | separator | name n | entry n | EOF | +---------+--------+-----------+--------+------------+--------+-----------+--------+------------+-----+ +Bytes: | 64 | 1 | 10 | 1-n (pack) | 64 | 1 | 10 | 1-n (pack) | 1 | +---------+--------+-----------+--------+------------+--------+-----------+--------+------------+-----+ +Example: | abc | 03 | foo | ... | abc | 03 | bar | ... | EOF | + +Explanations: +------------- + magic - Identifies the file and version of format + separator - Serves to detect end of strings with unknown/flexible length + count - Total amount of entries (not deleted) encoded in hexa-decimal + position - Seek position of current entry (which current() will give) + hash X - Hash sum of entry X (SHA 256) + name X - Name of stack the entries belongs in + entry X - The actual data, compressed with pack() + EOF - End-of-file character + ... - Data + ??? - Must be still found out which character/hashing algorthym fits best