meteor-node-stubs 1.2.22 → 1.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,5 @@
1
+ 'use strict';
2
+
1
3
  /**
2
4
  * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
3
5
  * in FIPS 180-2
@@ -6,48 +8,48 @@
6
8
  *
7
9
  */
8
10
 
9
- var inherits = require('inherits')
10
- var Sha256 = require('./sha256')
11
- var Hash = require('./hash')
12
- var Buffer = require('safe-buffer').Buffer
11
+ var inherits = require('inherits');
12
+ var Sha256 = require('./sha256');
13
+ var Hash = require('./hash');
14
+ var Buffer = require('safe-buffer').Buffer;
13
15
 
14
- var W = new Array(64)
16
+ var W = new Array(64);
15
17
 
16
- function Sha224 () {
17
- this.init()
18
+ function Sha224() {
19
+ this.init();
18
20
 
19
- this._w = W // new Array(64)
21
+ this._w = W; // new Array(64)
20
22
 
21
- Hash.call(this, 64, 56)
23
+ Hash.call(this, 64, 56);
22
24
  }
23
25
 
24
- inherits(Sha224, Sha256)
26
+ inherits(Sha224, Sha256);
25
27
 
26
28
  Sha224.prototype.init = function () {
27
- this._a = 0xc1059ed8
28
- this._b = 0x367cd507
29
- this._c = 0x3070dd17
30
- this._d = 0xf70e5939
31
- this._e = 0xffc00b31
32
- this._f = 0x68581511
33
- this._g = 0x64f98fa7
34
- this._h = 0xbefa4fa4
35
-
36
- return this
37
- }
29
+ this._a = 0xc1059ed8;
30
+ this._b = 0x367cd507;
31
+ this._c = 0x3070dd17;
32
+ this._d = 0xf70e5939;
33
+ this._e = 0xffc00b31;
34
+ this._f = 0x68581511;
35
+ this._g = 0x64f98fa7;
36
+ this._h = 0xbefa4fa4;
37
+
38
+ return this;
39
+ };
38
40
 
39
41
  Sha224.prototype._hash = function () {
40
- var H = Buffer.allocUnsafe(28)
42
+ var H = Buffer.allocUnsafe(28);
41
43
 
42
- H.writeInt32BE(this._a, 0)
43
- H.writeInt32BE(this._b, 4)
44
- H.writeInt32BE(this._c, 8)
45
- H.writeInt32BE(this._d, 12)
46
- H.writeInt32BE(this._e, 16)
47
- H.writeInt32BE(this._f, 20)
48
- H.writeInt32BE(this._g, 24)
44
+ H.writeInt32BE(this._a, 0);
45
+ H.writeInt32BE(this._b, 4);
46
+ H.writeInt32BE(this._c, 8);
47
+ H.writeInt32BE(this._d, 12);
48
+ H.writeInt32BE(this._e, 16);
49
+ H.writeInt32BE(this._f, 20);
50
+ H.writeInt32BE(this._g, 24);
49
51
 
50
- return H
51
- }
52
+ return H;
53
+ };
52
54
 
53
- module.exports = Sha224
55
+ module.exports = Sha224;
@@ -1,3 +1,5 @@
1
+ 'use strict';
2
+
1
3
  /**
2
4
  * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
3
5
  * in FIPS 180-2
@@ -6,130 +8,182 @@
6
8
  *
7
9
  */
8
10
 
9
- var inherits = require('inherits')
10
- var Hash = require('./hash')
11
- var Buffer = require('safe-buffer').Buffer
11
+ var inherits = require('inherits');
12
+ var Hash = require('./hash');
13
+ var Buffer = require('safe-buffer').Buffer;
12
14
 
13
15
  var K = [
14
- 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
15
- 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
16
- 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
17
- 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
18
- 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
19
- 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
20
- 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
21
- 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
22
- 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
23
- 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
24
- 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
25
- 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
26
- 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
27
- 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
28
- 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
29
- 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
30
- ]
31
-
32
- var W = new Array(64)
33
-
34
- function Sha256 () {
35
- this.init()
36
-
37
- this._w = W // new Array(64)
38
-
39
- Hash.call(this, 64, 56)
16
+ 0x428A2F98,
17
+ 0x71374491,
18
+ 0xB5C0FBCF,
19
+ 0xE9B5DBA5,
20
+ 0x3956C25B,
21
+ 0x59F111F1,
22
+ 0x923F82A4,
23
+ 0xAB1C5ED5,
24
+ 0xD807AA98,
25
+ 0x12835B01,
26
+ 0x243185BE,
27
+ 0x550C7DC3,
28
+ 0x72BE5D74,
29
+ 0x80DEB1FE,
30
+ 0x9BDC06A7,
31
+ 0xC19BF174,
32
+ 0xE49B69C1,
33
+ 0xEFBE4786,
34
+ 0x0FC19DC6,
35
+ 0x240CA1CC,
36
+ 0x2DE92C6F,
37
+ 0x4A7484AA,
38
+ 0x5CB0A9DC,
39
+ 0x76F988DA,
40
+ 0x983E5152,
41
+ 0xA831C66D,
42
+ 0xB00327C8,
43
+ 0xBF597FC7,
44
+ 0xC6E00BF3,
45
+ 0xD5A79147,
46
+ 0x06CA6351,
47
+ 0x14292967,
48
+ 0x27B70A85,
49
+ 0x2E1B2138,
50
+ 0x4D2C6DFC,
51
+ 0x53380D13,
52
+ 0x650A7354,
53
+ 0x766A0ABB,
54
+ 0x81C2C92E,
55
+ 0x92722C85,
56
+ 0xA2BFE8A1,
57
+ 0xA81A664B,
58
+ 0xC24B8B70,
59
+ 0xC76C51A3,
60
+ 0xD192E819,
61
+ 0xD6990624,
62
+ 0xF40E3585,
63
+ 0x106AA070,
64
+ 0x19A4C116,
65
+ 0x1E376C08,
66
+ 0x2748774C,
67
+ 0x34B0BCB5,
68
+ 0x391C0CB3,
69
+ 0x4ED8AA4A,
70
+ 0x5B9CCA4F,
71
+ 0x682E6FF3,
72
+ 0x748F82EE,
73
+ 0x78A5636F,
74
+ 0x84C87814,
75
+ 0x8CC70208,
76
+ 0x90BEFFFA,
77
+ 0xA4506CEB,
78
+ 0xBEF9A3F7,
79
+ 0xC67178F2
80
+ ];
81
+
82
+ var W = new Array(64);
83
+
84
+ function Sha256() {
85
+ this.init();
86
+
87
+ this._w = W; // new Array(64)
88
+
89
+ Hash.call(this, 64, 56);
40
90
  }
41
91
 
42
- inherits(Sha256, Hash)
92
+ inherits(Sha256, Hash);
43
93
 
44
94
  Sha256.prototype.init = function () {
45
- this._a = 0x6a09e667
46
- this._b = 0xbb67ae85
47
- this._c = 0x3c6ef372
48
- this._d = 0xa54ff53a
49
- this._e = 0x510e527f
50
- this._f = 0x9b05688c
51
- this._g = 0x1f83d9ab
52
- this._h = 0x5be0cd19
53
-
54
- return this
55
- }
56
-
57
- function ch (x, y, z) {
58
- return z ^ (x & (y ^ z))
95
+ this._a = 0x6a09e667;
96
+ this._b = 0xbb67ae85;
97
+ this._c = 0x3c6ef372;
98
+ this._d = 0xa54ff53a;
99
+ this._e = 0x510e527f;
100
+ this._f = 0x9b05688c;
101
+ this._g = 0x1f83d9ab;
102
+ this._h = 0x5be0cd19;
103
+
104
+ return this;
105
+ };
106
+
107
+ function ch(x, y, z) {
108
+ return z ^ (x & (y ^ z));
59
109
  }
60
110
 
61
- function maj (x, y, z) {
62
- return (x & y) | (z & (x | y))
111
+ function maj(x, y, z) {
112
+ return (x & y) | (z & (x | y));
63
113
  }
64
114
 
65
- function sigma0 (x) {
66
- return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
115
+ function sigma0(x) {
116
+ return ((x >>> 2) | (x << 30)) ^ ((x >>> 13) | (x << 19)) ^ ((x >>> 22) | (x << 10));
67
117
  }
68
118
 
69
- function sigma1 (x) {
70
- return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
119
+ function sigma1(x) {
120
+ return ((x >>> 6) | (x << 26)) ^ ((x >>> 11) | (x << 21)) ^ ((x >>> 25) | (x << 7));
71
121
  }
72
122
 
73
- function gamma0 (x) {
74
- return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
123
+ function gamma0(x) {
124
+ return ((x >>> 7) | (x << 25)) ^ ((x >>> 18) | (x << 14)) ^ (x >>> 3);
75
125
  }
76
126
 
77
- function gamma1 (x) {
78
- return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
127
+ function gamma1(x) {
128
+ return ((x >>> 17) | (x << 15)) ^ ((x >>> 19) | (x << 13)) ^ (x >>> 10);
79
129
  }
80
130
 
81
131
  Sha256.prototype._update = function (M) {
82
- var W = this._w
83
-
84
- var a = this._a | 0
85
- var b = this._b | 0
86
- var c = this._c | 0
87
- var d = this._d | 0
88
- var e = this._e | 0
89
- var f = this._f | 0
90
- var g = this._g | 0
91
- var h = this._h | 0
92
-
93
- for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
94
- for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
95
-
96
- for (var j = 0; j < 64; ++j) {
97
- var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
98
- var T2 = (sigma0(a) + maj(a, b, c)) | 0
99
-
100
- h = g
101
- g = f
102
- f = e
103
- e = (d + T1) | 0
104
- d = c
105
- c = b
106
- b = a
107
- a = (T1 + T2) | 0
108
- }
109
-
110
- this._a = (a + this._a) | 0
111
- this._b = (b + this._b) | 0
112
- this._c = (c + this._c) | 0
113
- this._d = (d + this._d) | 0
114
- this._e = (e + this._e) | 0
115
- this._f = (f + this._f) | 0
116
- this._g = (g + this._g) | 0
117
- this._h = (h + this._h) | 0
118
- }
132
+ var w = this._w;
133
+
134
+ var a = this._a | 0;
135
+ var b = this._b | 0;
136
+ var c = this._c | 0;
137
+ var d = this._d | 0;
138
+ var e = this._e | 0;
139
+ var f = this._f | 0;
140
+ var g = this._g | 0;
141
+ var h = this._h | 0;
142
+
143
+ for (var i = 0; i < 16; ++i) {
144
+ w[i] = M.readInt32BE(i * 4);
145
+ }
146
+ for (; i < 64; ++i) {
147
+ w[i] = (gamma1(w[i - 2]) + w[i - 7] + gamma0(w[i - 15]) + w[i - 16]) | 0;
148
+ }
149
+
150
+ for (var j = 0; j < 64; ++j) {
151
+ var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + w[j]) | 0;
152
+ var T2 = (sigma0(a) + maj(a, b, c)) | 0;
153
+
154
+ h = g;
155
+ g = f;
156
+ f = e;
157
+ e = (d + T1) | 0;
158
+ d = c;
159
+ c = b;
160
+ b = a;
161
+ a = (T1 + T2) | 0;
162
+ }
163
+
164
+ this._a = (a + this._a) | 0;
165
+ this._b = (b + this._b) | 0;
166
+ this._c = (c + this._c) | 0;
167
+ this._d = (d + this._d) | 0;
168
+ this._e = (e + this._e) | 0;
169
+ this._f = (f + this._f) | 0;
170
+ this._g = (g + this._g) | 0;
171
+ this._h = (h + this._h) | 0;
172
+ };
119
173
 
120
174
  Sha256.prototype._hash = function () {
121
- var H = Buffer.allocUnsafe(32)
122
-
123
- H.writeInt32BE(this._a, 0)
124
- H.writeInt32BE(this._b, 4)
125
- H.writeInt32BE(this._c, 8)
126
- H.writeInt32BE(this._d, 12)
127
- H.writeInt32BE(this._e, 16)
128
- H.writeInt32BE(this._f, 20)
129
- H.writeInt32BE(this._g, 24)
130
- H.writeInt32BE(this._h, 28)
131
-
132
- return H
133
- }
175
+ var H = Buffer.allocUnsafe(32);
176
+
177
+ H.writeInt32BE(this._a, 0);
178
+ H.writeInt32BE(this._b, 4);
179
+ H.writeInt32BE(this._c, 8);
180
+ H.writeInt32BE(this._d, 12);
181
+ H.writeInt32BE(this._e, 16);
182
+ H.writeInt32BE(this._f, 20);
183
+ H.writeInt32BE(this._g, 24);
184
+ H.writeInt32BE(this._h, 28);
185
+
186
+ return H;
187
+ };
134
188
 
135
- module.exports = Sha256
189
+ module.exports = Sha256;
@@ -1,57 +1,59 @@
1
- var inherits = require('inherits')
2
- var SHA512 = require('./sha512')
3
- var Hash = require('./hash')
4
- var Buffer = require('safe-buffer').Buffer
1
+ 'use strict';
5
2
 
6
- var W = new Array(160)
3
+ var inherits = require('inherits');
4
+ var SHA512 = require('./sha512');
5
+ var Hash = require('./hash');
6
+ var Buffer = require('safe-buffer').Buffer;
7
7
 
8
- function Sha384 () {
9
- this.init()
10
- this._w = W
8
+ var W = new Array(160);
11
9
 
12
- Hash.call(this, 128, 112)
10
+ function Sha384() {
11
+ this.init();
12
+ this._w = W;
13
+
14
+ Hash.call(this, 128, 112);
13
15
  }
14
16
 
15
- inherits(Sha384, SHA512)
17
+ inherits(Sha384, SHA512);
16
18
 
17
19
  Sha384.prototype.init = function () {
18
- this._ah = 0xcbbb9d5d
19
- this._bh = 0x629a292a
20
- this._ch = 0x9159015a
21
- this._dh = 0x152fecd8
22
- this._eh = 0x67332667
23
- this._fh = 0x8eb44a87
24
- this._gh = 0xdb0c2e0d
25
- this._hh = 0x47b5481d
26
-
27
- this._al = 0xc1059ed8
28
- this._bl = 0x367cd507
29
- this._cl = 0x3070dd17
30
- this._dl = 0xf70e5939
31
- this._el = 0xffc00b31
32
- this._fl = 0x68581511
33
- this._gl = 0x64f98fa7
34
- this._hl = 0xbefa4fa4
35
-
36
- return this
37
- }
20
+ this._ah = 0xcbbb9d5d;
21
+ this._bh = 0x629a292a;
22
+ this._ch = 0x9159015a;
23
+ this._dh = 0x152fecd8;
24
+ this._eh = 0x67332667;
25
+ this._fh = 0x8eb44a87;
26
+ this._gh = 0xdb0c2e0d;
27
+ this._hh = 0x47b5481d;
28
+
29
+ this._al = 0xc1059ed8;
30
+ this._bl = 0x367cd507;
31
+ this._cl = 0x3070dd17;
32
+ this._dl = 0xf70e5939;
33
+ this._el = 0xffc00b31;
34
+ this._fl = 0x68581511;
35
+ this._gl = 0x64f98fa7;
36
+ this._hl = 0xbefa4fa4;
37
+
38
+ return this;
39
+ };
38
40
 
39
41
  Sha384.prototype._hash = function () {
40
- var H = Buffer.allocUnsafe(48)
42
+ var H = Buffer.allocUnsafe(48);
41
43
 
42
- function writeInt64BE (h, l, offset) {
43
- H.writeInt32BE(h, offset)
44
- H.writeInt32BE(l, offset + 4)
45
- }
44
+ function writeInt64BE(h, l, offset) {
45
+ H.writeInt32BE(h, offset);
46
+ H.writeInt32BE(l, offset + 4);
47
+ }
46
48
 
47
- writeInt64BE(this._ah, this._al, 0)
48
- writeInt64BE(this._bh, this._bl, 8)
49
- writeInt64BE(this._ch, this._cl, 16)
50
- writeInt64BE(this._dh, this._dl, 24)
51
- writeInt64BE(this._eh, this._el, 32)
52
- writeInt64BE(this._fh, this._fl, 40)
49
+ writeInt64BE(this._ah, this._al, 0);
50
+ writeInt64BE(this._bh, this._bl, 8);
51
+ writeInt64BE(this._ch, this._cl, 16);
52
+ writeInt64BE(this._dh, this._dl, 24);
53
+ writeInt64BE(this._eh, this._el, 32);
54
+ writeInt64BE(this._fh, this._fl, 40);
53
55
 
54
- return H
55
- }
56
+ return H;
57
+ };
56
58
 
57
- module.exports = Sha384
59
+ module.exports = Sha384;