blob: 600b5c71f8ea0ac24fb486ffb702023a17026c4a (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 | 
### Binary Header 
Fixed 32-bytes
    -----------------------------------------------------------------
    |                             MAGIC                             |
    -----------------------------------------------------------------
    |  VERSION (0)  |      ENTRY SIZE (uint16BE)    | ALGO NAME LEN |
    -----------------------------------------------------------------
    |                                                               |
    |                                                               |
    |                                                               |
    |                 ALGORITHM NAME (lower-case string)            |
    |                                                               |
    |                                                               |
    -----------------------------------------------------------------
    MAGIC and ENTRY SIZE are both "big-endian", meaning that the "first" (aka
    "most-significant" byte is in the "first" memory location (aka, "lowest
    address").
    PREFIX LEN is max 24 (bytes)
    offset: 32 + entrySize * entryIndex
    count: (fileSize - 32) / entrySize
### SLEEP API
    SleepStorage trait
    SleepFile struct/impl
    get_magic() -> u32
    get_algorithm() -> &str
    read(index) -> &bytes[]
    write(index, &bytes[])
    len() -> u64
    First time around just do regular file seek() stuff
 |