diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-10-16 18:58:24 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-10-16 18:58:24 -0700 |
commit | bde2282d17474783d83a1e538beaaaff296115b7 (patch) | |
tree | 10ee31ffa370da8b80b7ba889bb3daa81f2ea34d /notes/sleep.md | |
parent | f565666eaffd3d442390bf9491fabcae15d9a08d (diff) | |
download | geniza-bde2282d17474783d83a1e538beaaaff296115b7.tar.gz geniza-bde2282d17474783d83a1e538beaaaff296115b7.zip |
initial structure
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 |