ait.dsn.cfdp.util module

ait.dsn.cfdp.util.bytes_to_string(data_bytes)

Converts list of bytes to a string

Arguments:
data_bytes:

list of bytes to be converted to a string

ait.dsn.cfdp.util.calc_checksum(filename)

Calculates the checksum of a file according to the CFDP Blue Book.

Arguments:
filename:

Full path of the file

ait.dsn.cfdp.util.calc_file_size(filepath)

Calculate size of a file

Arguments:
filepath:

Full path of the file

ait.dsn.cfdp.util.check_file_structure(target_file, segmentation_control)
ait.dsn.cfdp.util.checksum_of_word(word_list)

Returns of the value of a 4-byte word to be added to the running checksum.

Arguments:
word_list:

list of integers with max length 4 (more will be ignored), each integer representing a byte

ait.dsn.cfdp.util.string_length_in_bytes(s)

Returns length of a UTF-8 string in bytes

Arguments:
s:

The value whose length is calculated as string

ait.dsn.cfdp.util.string_to_bytes(value)

Converts string value to array of bytes

Arguments:
value:

string value to be converted to list of bytes

ait.dsn.cfdp.util.write_to_file(out_path, contents, offset=None)

Writes binary contents to file, at the optional offset

Arguments:
out_path:

Full path of the file to write to

contents:

Contents to write to file as binary

offset:

Optional offset to denote where in the file the contents should be written