Welcome Guest, Not a member yet? Register   Sign In
Base64 encoding
#4

(This post was last modified: 09-20-2021, 04:27 PM by richb201.)

urlencode actually seems different.
"Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs."

I read this as urlencode is ignoring - and _. I need to modify these as per the code above.

The base64URLEncode function above replaces both of these. What to do?

I'd like to simulate this function in php. How?


  return str.toString('base64')
    .replace(/\+/g, '-')
    .replace(/\//g, '_')
    .replace(/=/g, '');
}
proof that an old dog can learn new tricks
Reply


Messages In This Thread
Base64 encoding - by richb201 - 09-18-2021, 08:48 AM
RE: Base64 encoding - by InsiteFX - 09-19-2021, 12:45 AM
RE: Base64 encoding - by richb201 - 09-20-2021, 08:06 AM
RE: Base64 encoding - by richb201 - 09-20-2021, 10:29 AM
RE: Base64 encoding - by paulbalandan - 09-21-2021, 03:41 AM
RE: Base64 encoding - by richb201 - 09-21-2021, 06:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB