diff options
Diffstat (limited to 'notes/sleep.md')
-rw-r--r-- | notes/sleep.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/notes/sleep.md b/notes/sleep.md new file mode 100644 index 0000000..d13a489 --- /dev/null +++ b/notes/sleep.md @@ -0,0 +1,37 @@ + +### Binary Header + +Fixed 32-bytes + + ----------------------------------------------------------------- + | MAGIC | + ----------------------------------------------------------------- + | VERSION (0) | ENTRY SIZE (uint16BE) | ALGO NAME LEN | + ----------------------------------------------------------------- + | | + | | + | | + | ALGORITHM NAME (lower-case string) | + | | + | | + ----------------------------------------------------------------- + + + 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[]) + length() -> u64 + + First time around just do regular file seek() stuff |