String.contains#

usencrypt.cipher.String.contains(self, sub: str, start: int = 0, end: int = 0) usencrypt.cipher._boolean.Boolean#

Checks whether the encrypted string \(E(x)\) contains a given substring.

Parameters
  • sub (str) – The encrypted substring to be searched for.

  • start (int) – The index to begin searching at. Defaults to 0.

  • end (int) – The index to end searching at. Defaults to 0.

Returns

An encrypted boolean that represents whether self contains sub.

Return type

usencrypt.cipher.Boolean

Examples
>>> import usencrypt as ue
>>> ue_s = ue.encrypt('USEncryption')
>>> ue_sub = ue.encrypt('USE')
>>> ue.decrypt(ue_s.contains(ue_sub))
True