String.bubble#

usencrypt.cipher.String.bubble(array)#

Returns a sorted instance of list of encrypted strings based on their lexicographic order using the bubble sort algorithm.

Parameters

array (usencrypt.cipher.String) – A list of encrypted strings.

Returns

A sorted copy of array.

Return type

A list of usencrypt.cipher.String objects.

Note

All the encrypted strings in the resulting list will be padded if needed in order to match in length.

Examples
>>> import usencrypt as ue
>>> ue_s1 = ue.encrypt('apple')
>>> ue_s2 = ue.encrypt('bubble')
>>> ue_s3 = ue.encrypt('cat')
>>> ue_list = [ue_s1, ue_s2, ue_s2]
>>> ue.decrypt(ue_list)
['apple', 'bubble', 'cat']
>>> ue.decrypt(ue_s1.bubble(ue_list))
['apple\x00', 'bubble', 'cat\x00\x00\x00']