You are not logged in.
Pages: 1
Might be useful for people using HTTP stuff
Works just like regular base64 but with characters that can be used in URL
/// base64url_encode(string)
//
// returns encoded string
//
// s string to encode, string
//
/// GMLscripts.com/license
function base64url_encode(s) {
s = base64_encode(string(s));
s = string_replace_all(s, "/", "_");
s = string_replace_all(s, "=", "");
s = string_replace_all(s, "+", "-");
return s;
}
/// base64url_decode(string)
//
// returns decoded string
//
// s string to decode, string
//
/// GMLscripts.com/license
function base64url_decode(s) {
s = string(s);
s = string_copy(s + "===", 0, string_length(s) + (string_length(s) % 4));
s = string_replace_all(s, "_", "/");
s = string_replace_all(s, "-", "+");
return base64_decode(s);
}
Last edited by maras (2021-06-11 02:33:33)
I'm on the official GM discord > maras_cz
Offline
Thanks. After looking into this issue some I think this is probably the best way to go. I will be making some very minor tweaks but it will function the same.
Abusing forum power since 1986.
Offline
Pages: 1