usencrypt.is_encrypted#
- usencrypt.is_encrypted(x, dtype=None, check_collection=True, **kwargs)#
Checks if an object or collection is already encrypted with the USEncrypt® library.
- Parameters
x (any supported encryptable type) – Any object or collection.
dtype (
dtype
) – A specific subclass ofusencrypt.cipher.Ciphertext
to check for. Defaults toNone
.check_collection (
bool
) – Whether or not to check an iterable object recursively. IfFalse
, whenx
is any type of collection,False
is returned. Defaults toTrue
.
- Returns
True
ifx
is encrypted; otherwise, False.- Return type
- Examples
>>> import usencrypt as ue >>> a = ue.encrypt(0.756) >>> b = ue.is_encrypted(a) >>> ue.decrypt(b) True