dynamodb_encryption_sdk.internal.str_ops

Helper functions for consistently obtaining str and bytes objects in both Python2 and Python3.

Warning

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

Functions

to_bytes(data)

Takes an input str or bytes object and returns an equivalent bytes object.

to_str(data)

Takes an input str or bytes object and returns an equivalent str object.

dynamodb_encryption_sdk.internal.str_ops.to_str(data)[source]

Takes an input str or bytes object and returns an equivalent str object.

Parameters

data (str or bytes) – Input data

Returns

Data normalized to str

Return type

str

dynamodb_encryption_sdk.internal.str_ops.to_bytes(data)[source]

Takes an input str or bytes object and returns an equivalent bytes object.

Parameters

data (str or bytes) – Input data

Returns

Data normalized to bytes

Return type

bytes