From bde2282d17474783d83a1e538beaaaff296115b7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 16 Oct 2017 18:58:24 -0700 Subject: initial structure --- notes/sleep.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 notes/sleep.md (limited to 'notes/sleep.md') 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 -- cgit v1.2.3