aboutsummaryrefslogtreecommitdiffstats
path: root/notes/sleep.md
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-10-16 18:58:24 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-10-16 18:58:24 -0700
commitbde2282d17474783d83a1e538beaaaff296115b7 (patch)
tree10ee31ffa370da8b80b7ba889bb3daa81f2ea34d /notes/sleep.md
parentf565666eaffd3d442390bf9491fabcae15d9a08d (diff)
downloadgeniza-bde2282d17474783d83a1e538beaaaff296115b7.tar.gz
geniza-bde2282d17474783d83a1e538beaaaff296115b7.zip
initial structure
Diffstat (limited to 'notes/sleep.md')
-rw-r--r--notes/sleep.md37
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