virgil_sdk.utils.utils module

class virgil_sdk.utils.utils.Utils[source]

Bases: object

static b64_decode(source)[source]

Decode base64, padding being optional.

Parameters

source – Base64 data as an ASCII byte string

Returns

The decoded byte string.

static b64_encode(source)[source]

Removes any = used as padding from the encoded string.

Parameters

for encoding. (Data) –

Returns

Encoded data without ‘=’ sign

static b64decode(source)[source]

Convert source to bytearray and decode using base64.

static b64encode(source)[source]

Convert source to bytearray and encode using base64.

classmethod b64tobytes(source)[source]

Convert source to bytearray and encode using base64.

static check_unicode(source)[source]
static json_dumps(source, *args, **kwargs)[source]

Convert python dict to json string

static json_loads(source)[source]

Convert source to bytearray and deserialize from json to python dict object.

static normalize_string(source)[source]
static raise_from(exception)[source]

Supress long traceback for custom exceptions Python 3, show only important exception.

static strtobytes(source)[source]

Convert string to bytes tuple used for all crypto methods.

static to_timestamp(date)[source]
virgil_sdk.utils.utils.check_unicode(source)[source]
virgil_sdk.utils.utils.normalize_string(data_str)[source]