Xojo.Crypto.SHA256

From Xojo Documentation

Method

Xojo.Crypto.SHA256(data As Xojo.Core.MemoryBlock) As Xojo.Core.MemoryBlock

Supported for all project types and targets.

Generates SHA256 hash value for data.

Sample Code

Dim t As Text = "TestData"

// Convert text to a MemoryBlock
Dim textData As Xojo.Core.MemoryBlock
textData = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(t)

// Create SHA256
Dim sha1 As Xojo.Core.MemoryBlock
sha1 = Xojo.Crypto.SHA256(textData)

// Convert SHA256 to Text
// Note that this contains invalid UTF8 characters so really
// cannot be displayed
Dim sha1Text As Text
sha1Text = Xojo.Core.TextEncoding.UTF8.ConvertDataToText(sha1, True)