JavaScript: Base64 Encoding/Decoding
1 min read

JavaScript: Base64 Encoding/Decoding

Base64 is a reversible algorithm that allows us to transform binary data into a string of characters vice versa. For example, if we want to transfer some binary data across a network, Base64 encoding  might be a good fit.

Base64 is commonly used to encode images, font files, audio-video files etc. It is also widely used for sending e-mail attachments as well. Since it’s a reversible algorithm when we get a Base64 encoded file we can decode it to have the original one.

On the other hand, Base64 is not an encryption algorithm and it should not be used to hash passwords or sensitive data.
For that reason, Base64 encoding should be used wisely.