Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Util Plugin, MBS Encryption Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Encryption/SHA/SHA 256
This example is the version from Sun, 17th Mar 2012.
Project "SHA 256.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
dim s1 as string = SHA256MBS.HashText("Franz jagt im komplett verwahrlosten Taxi quer durch Bayern")
if s1 = "d32b568cd1b96d459e7291ebf4b25d007f275c9f13149beeb782fac0716613f8" then
// ok
else
MsgBox "Failed"
end if
dim s2 as string = SHA256MBS.Hash("Frank jagt im komplett verwahrlosten Taxi quer durch Bayern")
dim e2 as string = EncodingToHexMBS(s2)
if e2 = "78206a866dbb2bf017d8e34274aed01a8ce405b69d45db30bafa00f5eeed7d5e" then
// ok
else
MsgBox "Failed"
end if
dim s3 as string = SHA256MBS.Hash("")
dim e3 as string = EncodingToHexMBS(s3)
if e3 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" then
// ok
else
MsgBox "Failed"
end if
dim s as new SHA256MBS
s.Add "Franz jagt im komplett"
s.Add " verwahrlosten Taxi quer"
s.Add " durch Bayern"
dim r as string = s.ResultText
if r = "d32b568cd1b96d459e7291ebf4b25d007f275c9f13149beeb782fac0716613f8" then
' MsgBox "OK"
else
MsgBox "Failed"
end if
MsgBox "OK"
End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project
See also:
The items on this page are in the following plugins: MBS Encryption Plugin.