4 This is the format for a file-based stack which works as any Stackable class.
8 Purpose: | "magic" | separator | count | separator | position | separator |
9 ---------+-----------+-----------+----------+-----------+------0---+-----------+
10 Bytes: | 9 | 1 | 20 (hex) | 1 | 20 (hex) | 1 |
11 ---------+-----------+-----------+----------+-----------+----------+-----------+
12 Example: | STACKv1.0 | 01 | 00...ff | 01 | 00...ff | 02 |
16 Purpose: | hash 0 | separator | name 0 | entry 0 | hash n | separator | name n | entry n | EOF |
17 ---------+--------+-----------+--------+------------+--------+-----------+--------+------------+-----+
18 Bytes: | 64 | 1 | 10 | 1-n (pack) | 64 | 1 | 10 | 1-n (pack) | 1 |
19 ---------+--------+-----------+--------+------------+--------+-----------+--------+------------+-----+
20 Example: | abc | 03 | foo | ... | abc | 03 | bar | ... | EOF |
24 magic - Identifies the file and version of format
25 separator - Serves to detect end of strings with unknown/flexible length
26 count - Total amount of entries (not deleted) encoded in hexa-decimal
27 position - Seek position of current entry (which current() will give)
28 hash X - Hash sum of entry X (SHA 256)
29 name X - Name of stack the entries belongs in
30 entry X - The actual data, compressed with pack()
31 EOF - End-of-file character
33 ??? - Must be still found out which character/hashing algorthym fits best