@priotas/angular-utf8-base64

0.0.6 • Public • Published

Build Status

angular-utf8-base64

AngularJS service for UTF-8 and Base64 and Base64url Javascript Encoding

angular-utf8-base64 is based on Really fast Javascript Base64 encoder/decoder with utf-8 support. I just wrapped it as AngularJS service.

There is another AngularJS service for Base64 encoding available. But it doesn't support UTF-8.

Installation

Bower

bower install angular-utf8-base64
<script src="bower_components/angular-utf8-base64/angular-utf8-base64.min.js"></script>

Usage

angular
    .module('myApp', ['ab-base64'])
    .controller('myController', [

        '$scope','base64',
        function($scope,base64) {

            $scope.encoded = base64.encode('a string');
            $scope.decoded = base64.decode('YSBzdHJpbmc=');
    }]);

Base64Url Support

Commonly used for supporting JWS and JWT encodings, base64url encoding creates a URL safe output.

angular
    .module('myApp', ['ab-base64'])
    .controller('myController', [

        '$scope','base64',
        function($scope,base64) {

            $scope.encoded = base64.urlencode('a string');
            $scope.decoded = base64.urldecode('YSBzdHJpbmc');
    }]);

Readme

Keywords

none

Package Sidebar

Install

npm i @priotas/angular-utf8-base64

Weekly Downloads

35

Version

0.0.6

License

none

Unpacked Size

20.9 kB

Total Files

13

Last publish

Collaborators

  • madflow