4 This is the format for a file-based stack which works as any Stackable class.
8 Purpose: | "magic" | separator | count | position | separator |
9 ---------+-----------+-----------+----------+---------------+-----------+
10 Bytes: | 9 | 1 | 20 (hex) | 2 - n^2 (hex) | 1 |
11 ---------+-----------+-----------+----------+---------------+-----------+
12 Example: | STACKv1.0 | 00 | 00...ff | 01 | ff |
16 Purpose: | hash 0 | separator | name 0 | entry 0 | hash n | separator | name n | entry n | EOF |
17 ---------+--------+-----------+--------+------------+--------+-----------+--------+------------+-----+
18 Bytes: | ??? | 1 | 10 | 1-n (pack) | ??? | 1 | 10 | 1-n (pack) | 1 |
19 ---------+--------+-----------+--------+------------+--------+-----------+--------+------------+-----+
20 Example: | abc | ??? | foo | ... | abc | ??? | 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
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
32 ??? - Must be still found out which character/hashing algorthym fits best