From 6350f421a13fe243a54b114f37ce7714fb5c0af0 Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Tue, 10 Nov 2020 10:31:56 -0700 Subject: [PATCH] DB Format --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b70a70e..af2f697 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,48 @@ # binary_address_book -binary address book from text manipulation chapter \ No newline at end of file +binary address book from text manipulation chapter + +# Address Book Fields +Things to store +1. First name(s) +2. Last name +3. Street Address +4. City +5. State/Province +6. Post Code +7. Phone Number +8. Extra + +There can be any number of extras + +# Binary Format + +The binary format for the address book starts with a DB Header. Immediately following the DB Header is the first record header. Each record header is followed by the number of field headers indicated by the field count. + +## DB Header + +1. Magic 0xDB +2. u4 major +3. u4 minor version +4. u16 reserved +3. u32 record count + +## Record Header + +1. u8 field count +2. u8 length - not including header +3. u16 crc16-arc - not including header + +022094A6 + +## Field +Hex +0100034a6f6e020006fa616e78a656e +``` +Field 1 - First Name(s) +Length 3 +Jon +Field 2 - Last Name +Length 6 +Janzen +``` \ No newline at end of file