super: Object

The Crypto module provides cryptographic and encoding functionalities.


  • Load() This event is called when the object becames available in the current runtime system.

  • Unload() This event is called when the object has been removed from the current runtime system (but not yet deallocated).

Class Methods

  • func md5(string: String): String Compute MD5 digest algorithm.

  • func sha1(string: String): String Compute SHA1 digest algorithm.

  • func sha256(string: String): String Compute SHA256 digest algorithm.

  • func sha512(string: String): String Compute SHA512 digest algorithm.

  • func UUID(): String Create and returns a new UUID with RFC 4122 version 4 random bytes.

  • func hmacSHA256(string: String, key: String): String Compute HMAC-SHA256.

  • func encodeStringToBase64(string: String): String Encode string to base64 string.

  • func decodeStringFromBase64(string: String): String Decode string from base64 string.

  • func encodeDataToBase64(data: Data): String Encode data to base64 string.

  • func decodeDataFromBase64(string: String): Data Decode data from base64 string.