2017-01-22 2 views

답변

8

atob 및 btoa는 JavascriptCore에서 지원되지 않지만 Chrome 디버거에서 실행될 때 작동합니다. JS 코드가 디버그시 Chrome에서 실행되기 때문입니다. 많은 base64 모듈이 있습니다. https://github.com/mathiasbynens/base64 나를 위해 잘 작동합니다.

1

나를 위해 일한 간단한 방법은 노드와 동일한 api입니다.

버퍼를 설치 yarn add buffer

용도 : console.log(Buffer.from("Hello World").toString('base64')); console.log(Buffer.from("SGVsbG8gV29ybGQ=", 'base64').toString('ascii'));

관련 문제