Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Encode mode basics

Darren Ldl edited this page May 18, 2019 · 6 revisions

Encode

Encode command with most options used

blkar encode INFILE OUT --sbx-version VERSION --hash-type HASH --rs-data DATA --rs-parity PARITY --burst BURST

DATA, PARITY, BURST are ignored if the VERSION is not one of 17, 18, 19.

Output file path determination

blkar attempts to do smart output file name computation, the full decision tree of how the final output path is calculated is shown below

  • if OUT does not exist
    • OUT is used directly
  • else
    • if OUT is a directory
      • final output path will be OUT/INFILE.sbx
    • else
      • OUT is used directly

Error correction configuration

In error correction enabled versions (17, 18, 19), $DATA SBX data blocks are followed by PARITY SBX parity blocks, this forms a single block set. For every block set, you can lose up to PARITY blocks. Metadata blocks are also duplicated PARITY times as well.

Invoke blkar calc mode(see below) for a more thorough explanation of a certain configuration, or see here for more details on the container format.

BURST indicates the burst error resistance level. It essentially means the container can tolerate PARITY burst errors in every block set, and each burst error may be up to BURST SBX blocks. See here for more details on how block sets are interleaved to achieve this.

Tables and lists

Table of features of the different features. The table can also be seen by invoking blkar encode --help.

SBX block size FEC enabled Burst error resistance File extension
1 512 bytes no not supported .sbx
2 128 bytes no not supported .sbx
3 4096 bytes no not supported .sbx
(default) 17 (0x11) 512 bytes yes supported .ecsbx
18 (0x12) 128 bytes yes supported .ecsbx
19 (0x13) 4096 bytes yes supported .ecsbx

Details of default option: sbx-version=17, rs-data=10, rs-parity=2, burst=10

List of hash algorithms supported: sha1, sha256(default), sha512, blake2b-512.

The list can also be seen by invoking blkar encode --help.

Basic data calculation

Invoking encode mode with the flag --info-only will invoke a dry run - blkar displays some information regarding the output container then exit.

Sample output

$ blkar encode test --info-only
File name                    : test
SBX container name           : test.sbx
SBX container version        : 17
SBX container block size     : 512
SBX container data  size     : 496
RS data   shard count        : 10
RS parity shard count        : 2
Burst error resistance level : 20
File size                    : 677
SBX container size           : 114688
File modification time       : 2019-04-05 08:55:45 (UTC)  2019-04-05 19:55:45 (Local)

The information is not very detailed by design. If you need more information, see Calc mode basics.