angular-base64
Encapsulation of Nick Galbreath's base64.js library for AngularJS
For Base64 encoding whch supports UTF8 see angular-utf8-base64
Installation
Bower
bower install angular-base64
NB: The ngBase64
bower package is deprecated due to camel casing issues on case-sensitive file systems.
Usage
angular ;
Unicode
You can encode unicode strings using base64 as described here.
angular ;
URL Safety
If you want to transmit a base64 encoded string in a url you must make it "URL safe" by encoding it with encodeURIComponent
.
var base64EncodedString = $base64;var urlSafeBase64EncodedString = ;
To decode the above string use decodeURIComponent
, then decode
.
var base64EncodedString = ;var decodedString = $base64;