Odoo Technical

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

How can you encode and decode a string using Base64 in JavaScript?

Avatar
ashok_k

How can you encode and decode a string using Base64 in JavaScript?

Avatar
Discard
1 Answer
0
Avatar
gowthami
Best Answer

Topic : General
Language: JS (Window instance )
atob() && btoa()
atob- Decodes a string of data which has been encoded using base-64 encoding.
btoa- Encodes a string of data into base-64 encoding.
Syntax: atob(encodedata)
Eg:
    const encodedData = btoa("Hello Mates"); // encode a string
    const decodedData = atob(encodedData); // decode the string

Avatar
Discard