Module ben::decode

source ·
Expand description

This module contains the main functions for decoding XBEN and BEN files.

XBEN files are generally transformed back into BEN files, and BEN files are transformed into a JSONL file with the formatting

{"assignment": [...], "sample": #}

The BEN file format is a bit-packed binary format that is used to store run-length encoded assignment vectors, and is streamable. Therefore, the BEN file format works well with the read submodule of this module which is designed to extract a single assignment vector from a BEN file.

Modules§

  • Module documentation.

Functions§

  • This is a helper function that is designed to read in a single ben encoded line and convert it to a regular run-length encoded assignment vector.
  • This function takes a reader containing a file encoded in the XBEN format and decodes it into a BEN file.
  • This function takes a reader containing a file encoded in the BEN format and decodes it into a JSONL file.
  • This function takes a reader containing a file encoded in the XBEN format and decodes it into a JSONL file.
  • This is a convenience function that decodes a general level 9 LZMA2 compressed file.