Created
April 23, 2019 18:36
-
-
Save gosukiwi/4739571476652e4c03f8fca88a39d465 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This makes sure UTF8 characters don't break the encoding/decoding. For | |
# more info: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding | |
# | |
App.Lib.Base64 = | |
encode: (str) -> | |
window.btoa unescape(encodeURIComponent(str)) | |
decode: (str) -> | |
decodeURIComponent escape(window.atob(str)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment