Base64 encoding and decoding in client-side Javascript

前端 未结 14 2049
挽巷
挽巷 2020-11-22 04:27

Are there any methods in JavaScript that could be used to encode and decode a string using base64 encoding?

14条回答
  •  隐瞒了意图╮
    2020-11-22 05:18

    In Gecko/WebKit-based browsers (Firefox, Chrome and Safari) and Opera, you can use btoa() and atob().

    Original answer: How can you encode a string to Base64 in JavaScript?

提交回复
热议问题