openssh_key.pascal_style_byte_stream.PascalStyleFormatInstructionStringLengthSize

class openssh_key.pascal_style_byte_stream.PascalStyleFormatInstructionStringLengthSize(format_instruction: openssh_key.pascal_style_byte_stream.PascalStyleFormatInstruction, string_length_size: int)

Bases: NamedTuple

A format instruction for a variable-length value, and the size, in bytes, of the unsigned int prefix describing the value’s length in bytes.

Example

Reading b'\x00\x00\x03abc' with a format_instruction of PascalStyleFormatInstruction.STRING and a string_length_size of 3 yields a str, viz. 'abc'.

__init__()

Methods

__init__()

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes

format_instruction

The format instruction.

string_length_size

The size of the length prefix.

count(value, /)

Return number of occurrences of value.

format_instruction: openssh_key.pascal_style_byte_stream.PascalStyleFormatInstruction

The format instruction.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

string_length_size: int

The size of the length prefix.