comp • gb.openssl • digest

Digest (gb.openssl)

This class wraps the hash algorithms of the OpenSSL project. See Wikipedia: Cryptographic hash function for a start on hash functions.

This class is static.
This class acts like a
Dim hDigestMethod As comp/gb.openssl.Digest.Method
static array.

Static properties

Static methods
Static property Read List As String
Static Function IsSupported ( method As String ) As Boolean


You get the virtual object which represents a specific algorithm by using its name as a key to index the Digest class. From this virtual object, you can hash messages. So, to produce a SHA-256 digest of a string, we would use:

Print Base64$(Digest["sha256"]("Gambas Almost Means BASIC!"))
' >> uIcY2lpgsRRkYrY4ETvuAJQmTMrpqV0TckAShNSl+KI=

Keep in mind that the hash functions return raw binary data which can do strange things with your terminal when printed. If you intend to print them, you should use the built-in Base64$ function.