0.0.1 • Published 3 years ago

blockrc v0.0.1

Weekly downloads
48
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

What is blockrc!

The blockrc is an unsearchable data storage lib for blockchain based calculation. Its designed for larger data collection. Where the search is not important, just the fast data io. The blocks are buffers so they can hold anything. (string, integer, json, binary(jpeg,ogg,mp4)) Some data can be multi block size.

Block types.

Fix sized block type.

The simpliest block collection every block holding the same size of data. Easy for extend and easy to change.

File format

  +--------------------------------------------------------------+
  |                          header (8192 bytes)                 |
  |+-------+---------------+---------------+--------------------+|
  || bl0ck | size (Uint16) | count (UInt32 | timestamp (UInt32) ||
  |+-------+---------------+---------------+--------------------+|
  ||                          reversed (81757 bytes)            ||
  |+------------------------------------------------------------+|
  +--------------------------------------------------------------+
  |                           body                               |
  |   +-------+-------+-------+-------+-------+-------+-------+  |
  |   | block | block | block | block | block | block | block |  |
  |   +-------+-------+-------+-------+-------+-------+-------+  |
  |   | block | block | block | block | block | block | block |  |
  |   +-------+-------+-------+-------+-------+-------+-------+  |
  |   | block | block | block | block | block | block | block |  |
  |   +-------+-------+-------+-------+-------+-------+-------+  |
  |   | block | block | block | block | block | block | block |  |
  |   +-------+-------+-------+-------+-------+-------+-------+  |
  +--------------------------------------------------------------+

Block format

  +--------------------------------------------------------------+
  |                       Head (32 bytes)                        |
  | +------------------+----------------------+----------------+ |
  | | lastmod (Uint32) | currentSize (Uint16) | type (2 bytes) | |
  | +------------------+----------------------+----------------+ |
  | | nBlock (UInt32)  | crc (Uint32)         |                | |
  | +------------------+----------------------+                | |
  | |                    reversed (16 bytes)                   | |
  | +----------------------------------------------------------+ |
  +--------------------------------------------------------------+
  |                          Data                                |
  +--------------------------------------------------------------+

block type

bitfunction
1empty
2multi
3compressed
4encrypted
5reversed
6reversed
7reversed
8reversed
9reversed
10reversed
11reversed
12reversed
13reversed
14reversed
15reversed
16reversed

Dynamic block size type

Only for full backup/migration.

planned features.

-crc32 support -last modification time stamp -compression support -encryption support -threat safety