Skip to content

Commit

Permalink
v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Jun 28, 2015
1 parent cce3b3a commit a6c7138
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
10 changes: 5 additions & 5 deletions lib/bcrypt.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

/*!
* utils - bcrypt
* Copyright(c) 2015 Fangdun Cai
* MIT Licensed
*/

'use strict';

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _thenifyAll = require('thenify-all');

var _thenifyAll2 = _interopRequireDefault(_thenifyAll);
Expand All @@ -16,4 +16,4 @@ var _bcrypt = require('bcrypt');

var _bcrypt2 = _interopRequireDefault(_bcrypt);

_thenifyAll2['default'](_bcrypt2['default'], exports, ['genSalt', 'compare', 'hash']);
(0, _thenifyAll2['default'])(_bcrypt2['default'], exports, ['genSalt', 'compare', 'hash']);
12 changes: 6 additions & 6 deletions lib/jwt.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*!
* utils - jwt
* Copyright(c) 2015 Fangdun Cai
* MIT Licensed
*/

'use strict';

Object.defineProperty(exports, '__esModule', {
Expand All @@ -6,12 +12,6 @@ Object.defineProperty(exports, '__esModule', {

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

/*!
* utils - jwt
* Copyright(c) 2015 Fangdun Cai
* MIT Licensed
*/

var _jsonwebtoken = require('jsonwebtoken');

var _jsonwebtoken2 = _interopRequireDefault(_jsonwebtoken);
Expand Down
16 changes: 8 additions & 8 deletions lib/pbkdf2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*!
* utils - pbkdf2
* Copyright(c) 2015 Fangdun Cai
* MIT Licensed
*/

'use strict';

Object.defineProperty(exports, '__esModule', {
Expand All @@ -6,12 +12,6 @@ Object.defineProperty(exports, '__esModule', {

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

/*!
* utils - pbkdf2
* Copyright(c) 2015 Fangdun Cai
* MIT Licensed
*/

var _mzCrypto = require('mz/crypto');

var _token = require('./token');
Expand All @@ -30,7 +30,7 @@ function genSalt() {
var len = arguments[0] === undefined ? 16 : arguments[0];
var encoding = arguments[1] === undefined ? 'hex' : arguments[1];

return _token2['default'](len, encoding);
return (0, _token2['default'])(len, encoding);
}

/**
Expand Down Expand Up @@ -75,7 +75,7 @@ function hash(password, salt) {
var digest = arguments[4] === undefined ? 'sha256' : arguments[4];
var encoding = arguments[5] === undefined ? 'hex' : arguments[5];

return _mzCrypto.pbkdf2(password, salt, iterations, keylen, digest).then(function (buf) {
return (0, _mzCrypto.pbkdf2)(password, salt, iterations, keylen, digest).then(function (buf) {
return buf.toString(encoding);
});
}
Expand Down
13 changes: 7 additions & 6 deletions lib/token.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
'use strict';

Object.defineProperty(exports, '__esModule', {
value: true
});
/*!
* utils - token
* Copyright(c) 2015 Fangdun Cai
* MIT Licensed
*/

'use strict';

Object.defineProperty(exports, '__esModule', {
value: true
});

var _mzCrypto = require('mz/crypto');

/*
Expand All @@ -25,7 +26,7 @@ function token() {
var len = arguments[0] === undefined ? 20 : arguments[0];
var encoding = arguments[1] === undefined ? 'hex' : arguments[1];

return _mzCrypto.randomBytes(len).then(function (buf) {
return (0, _mzCrypto.randomBytes)(len).then(function (buf) {
return buf.toString(encoding);
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trek-utils",
"version": "0.3.0",
"version": "0.4.0",
"description": "Trek utils",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit a6c7138

Please sign in to comment.