DecodeBase32 (open)
Decodes an RFC 4648 base-32 encoded string.
Syntax
// Core function, no LOADLIB necessary
STRING FUNCTION DecodeBase32(STRING value)
Parameters
STRING value
String to decode
Return value
STRING
The decoded string, or an empty string when decoding failed because of an invalid character
Description
DecodeBase32 will decode a base-32 encoded string to its original value. Letters can be either uppercase or lowercase. The alphabet used is the one from RFC 4648 (table 3, chapter 6). The input value doesn't have to be fully padded (the trailing '=' characters are not required).
Examples
// returns "Hello, World"
STRING example1 := DecodeBase32("jbswy3dpfqqfo33snrsa");
// returns "123"
STRING example2 := DecodeBase32("GEZDG===");
// returns "", this base32hex-encoded string cannot be base32-decoded
STRING example3 := DecodeBase32("91imor3f5gg5erridhi0");