Skip to main content

encode_length

Function encode_length 

Source
pub fn encode_length(mtype: MainType, length: u32) -> IsccResult<u32>
Expand description

Encode bit length to header length field value.

Semantics depend on MainType:

  • META/SEMANTIC/CONTENT/DATA/INSTANCE/FLAKE: (bit_length / 32) - 1
  • ISCC: pass-through (0–7, unit composition flags)
  • ID: (bit_length - 64) / 8