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 static array.
Static properties
|
Static methods
|
|
|
|
Example
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:
Use "gb.openssl"
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.