rascal
rascal copied to clipboard
Base32 support
This PR adds support for base-32 encoding, similar to the base-64 encoding that was already present. It also adds support for a "charset" keyword parameter to the existing base-64 string functions. Functions added:
IO: public java str readBase32(loc file)
IO: public java void writeBase32(loc file, str content)
String: public java str toBase32(str src, str charset=DEFAULT_CHARSET, bool includePadding=true);
String: public java str fromBase32(str src, str charset=DEFAULT_CHARSET);
Functions that received an extra charset keyword parameter:
String: public java str toBase64(str src, str charset=DEFAULT_CHARSET);
String: public java str fromBase64(str src, str charset=DEFAULT_CHARSET);