base64 encode and decode a string in angular (2+)

前端 未结 4 2001
被撕碎了的回忆
被撕碎了的回忆 2020-12-04 17:06

How to encode or decode a string in angular 2 with base64 ??? My front-end tool is Angular 2. I had a password string, before passing it to API I n

4条回答
  •  情话喂你
    2020-12-04 17:41

    Use btoa("yourstring")

    more info: https://developer.mozilla.org/en/docs/Web/API/WindowBase64/Base64_encoding_and_decoding

    TypeScript is a superset of Javascript, it can use existing Javascript libraries and web APIs

提交回复
热议问题