Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# This makes sure UTF8 characters don't break the encoding/decoding. For
# more info:
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