Crypto.Hash

From Xojo Documentation

Method

Crypto.Hash(data As MemoryBlock, hashAlgorithm As Crypto.HashAlgorithms) As MemoryBlock

New in 2019r21

Supported for all project types and targets.

Creates a hash value for the data using the specified hashAlgorithm.


Method

Crypto.Hash(data As MemoryBlock, hashAlgorithm As Crypto.Algorithm) As MemoryBlock

New in 2012r2

Supported for all project types and targets.

Creates a hash value for the data using the specified hashAlgorithm.

Notes

Use the Crypto.HashAlgorithms enumeration with the Hash method to specify the type of hash. It has these values:

  • MD5
  • SHA1
  • SHA256
  • SHA512

Sample Code

This code calculates a hash for a password using SHA512:

Var hash As String
hash = Crypto.Hash("YourPasswordSentence", Crypto.HashAlgorithms.SHA512)