Specifically for URL-safe base64 encoding. Uses -
and _
instead of, respectively, +
and /
. Padding with =
is optional. Source: https://en.wikipedia.org/wiki/Base64#URL_applications
Questions tagged [base64url]
107 questions
-1
votes
1 answer
Is there a native JS method for converting `+` and `/` to `-` and `_` prior to base64url encoding? What is it?
I'm reading through a codebase and noticed the author manually uses replace to sanitize a string prior to base64url encoding, as per the base64url specification.
str = str.replace(/=+$/, ''); // remove padding equal characters
str =…

neaumusic
- 10,027
- 9
- 55
- 83
-4
votes
2 answers
Detect malicious code or text inside base64 dataURL image
I have the following 3 "dataURL image", all of them returns the same image if you open them via "URL", but two of the below dataURL code has "PHP code" and "JavaScript code" embedded on last.
How can I remove those malicious codes from my base64…

John Cargo
- 1,839
- 2
- 29
- 59