Skip to content

diablofong/angular-hmac-sha512

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-hmac-sha512

AngularJS Module. that integrate cryptography functionality offers from the crypto-js project. A Simple Service to Encrypt Use Hmac-sha512.

#required

#install(bower)

  • bower install angular-hmac-sha512
<script type='text/javascript' src="[bower_components/]angular-hmac-sha512/src/angular-hmac-sha512.js"></script>

#install(manual)

<script type='text/javascript' src="src/angular-hmac-sha512.js"></script>

#usage

  • add encrypt module to angular
 var myApp = angular.module('app', ['angular-hmac-sha512']); 
  • set Secret in config or controller
 //in config
 angular.module.('app').config(['$crypthmacProvider', 	function($crypthmacProvider){
   		$crypthmacProvider.setCryptoSecret('jfoiwjfwoifje83');
 });
 
 //in controller
 App.controller('demo_nosecret',['$scope','$crypthmac',function($scope,$crypthmac){
	$scope.execute = function () {
		var encrypttext = $crypthmac.encrypt($scope.plantext,"");
	};
}]);
  • example to use encrypt
 //in controller
 App.controller('demo_nosecret',['$scope','$crypthmac',function($scope,$crypthmac){
	$scope.execute = function () {
		var encrypttext = $crypthmac.encrypt($scope.plantext,"");
		console.log(encrypttext);
	};
}]);

#demo

###demo site

#License

###The MIT License (MIT)

About

AngularJS Module. A Simple Service to Encrypt Use Hmac-sha512

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages