dfvfs.encoding package

Submodules

dfvfs.encoding.base16_decoder module

The base16 decoder implementation.

class dfvfs.encoding.base16_decoder.Base16Decoder[source]

Bases: Decoder

Base16 decoder using base64.

Decode(encoded_data)[source]

Decode the encoded data.

Parameters:

encoded_data (byte) – encoded data.

Returns:

decoded data and remaining encoded data.

Return type:

tuple(bytes, bytes)

Raises:

BackEndError – if the base16 stream cannot be decoded.

ENCODING_METHOD = 'base16'

dfvfs.encoding.base32_decoder module

The base32 decoder implementation.

class dfvfs.encoding.base32_decoder.Base32Decoder[source]

Bases: Decoder

Base32 decoder using base64.

Decode(encoded_data)[source]

Decode the encoded data.

Parameters:

encoded_data (byte) – encoded data.

Returns:

decoded data and remaining encoded data.

Return type:

tuple(bytes, bytes)

Raises:

BackEndError – if the base32 stream cannot be decoded.

ENCODING_METHOD = 'base32'

dfvfs.encoding.base64_decoder module

The base64 decoder implementation.

class dfvfs.encoding.base64_decoder.Base64Decoder[source]

Bases: Decoder

Base64 decoder using base64.

Decode(encoded_data)[source]

Decode the encoded data.

Parameters:

encoded_data (byte) – encoded data.

Returns:

decoded data and remaining encoded data.

Return type:

tuple(bytes, bytes)

Raises:

BackEndError – if the base64 stream cannot be decoded.

ENCODING_METHOD = 'base64'

dfvfs.encoding.decoder module

The decoder interface.

class dfvfs.encoding.decoder.Decoder[source]

Bases: object

Decoder interface.

abstract Decode(encoded_data)[source]

Decodes the encoded data.

Parameters:

encoded_data (byte) – encoded data.

Returns:

decoded data and remaining encoded data.

Return type:

tuple(bytes, bytes)

dfvfs.encoding.manager module

The encoding manager.

class dfvfs.encoding.manager.EncodingManager[source]

Bases: object

Encoding manager.

classmethod DeregisterDecoder(decoder)[source]

Deregisters a decoder for a specific encoding method.

Parameters:

decoder (type) – decoder class.

Raises:

KeyError – if the corresponding decoder is not set.

classmethod GetDecoder(encoding_method)[source]

Retrieves the decoder object for a specific encoding method.

Parameters:

encoding_method (str) – encoding method identifier.

Returns:

decoder or None if the encoding method does not exists.

Return type:

Decoder

classmethod RegisterDecoder(decoder)[source]

Registers a decoder for a specific encoding method.

Parameters:

decoder (type) – decoder class.

Raises:

KeyError – if the corresponding decoder is already set.

classmethod RegisterDecoders(decoders)[source]

Registers decoders.

The decoders are identified based on their lower case encoding method.

Parameters:

decoders (list[type]) – decoder classes.

Raises:

KeyError – if decoders is already set for the corresponding encoding method.

Module contents

Imports for the encoding manager.