dynamodb_encryption_sdk.internal.formatting.serialize

Helper functions for serializing values.

Warning

No guarantee is provided on the modules and APIs within this namespace staying consistent. Directly reference at your own risk.

Functions

encode_length(attribute)

Encodes the length of the attribute as an unsigned int.

encode_value(value)

Encodes the value in Length-Value format.

dynamodb_encryption_sdk.internal.formatting.serialize.encode_length(attribute: Sized) bytes[source]

Encodes the length of the attribute as an unsigned int.

Parameters

attribute – Attribute with length value

Returns

Encoded value

Return type

bytes

dynamodb_encryption_sdk.internal.formatting.serialize.encode_value(value: bytes) bytes[source]

Encodes the value in Length-Value format.

Parameters

value (six.string_types or boto3.dynamodb_encryption_sdk.types.Binary) – Value to encode

Returns

Length-Value encoded value

Return type

bytes