-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
69 lines (62 loc) · 1.34 KB
/
index.js
File metadata and controls
69 lines (62 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
'use strict';
/**
* @file arc4 main
* @module arc4
* @subpackage main
* @version 3.3.0
* @author hex7c0 <hex7c0@gmail.com>
* @copyright hex7c0 2014
* @license GPLv3
*/
/*
* initialize module
*/
var min = __dirname + '/min/lib/';
var minNormal = min + 'normal/index.js';
var minLodash = min + 'lodash/index.js';
/*
* functions
*/
/**
* export
*
* @exports arc4
* @function arc4
* @param {String} algorithm - user key
* @param {String|Array|Buffer} password - user key
* @param {Boolean} [lodash] - flag
* @return {Object}
*/
function arc4(algorithm, password, lodash) {
if (!lodash) {
return require(minNormal)(algorithm, password);
}
return require(minLodash)(algorithm, password);
}
module.exports = arc4;
/**
* export normal function
*
* @exports normal
* @function normal
* @param {String} algorithm - user key
* @param {String|Array|Buffer} password - user key
* @return {Object}
*/
function normal(algorithm, password) {
return require(minNormal)(algorithm, password);
}
module.exports.normal = normal;
/**
* export normal function
*
* @exports normal
* @function normal
* @param {String} algorithm - user key
* @param {String|Array|Buffer} password - user key
* @return {Object}
*/
function lodash(algorithm, password) {
return require(minLodash)(algorithm, password);
}
module.exports.lodash = lodash;