├── .eslintrc.js
├── .gitignore
├── LICENSE
├── README.md
├── bin
└── js-spg
├── build
└── jsspg.min.js
├── lib
├── jsspg.js
└── unicodeBlocks.js
├── package-lock.json
├── package.json
├── test
└── index.js
└── webpack.config.js
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "extends": "airbnb-base",
3 | "plugins": [
4 | "import"
5 | ]
6 | };
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Javascript Strong Unicode Password Generator
2 |
3 | [](https://www.taleas.com/comics/magician-wrong-password.html)
4 |
5 | This tool is based on Jeff Atwood's Post ["Password Rules Are Bullshit"](https://blog.codinghorror.com/password-rules-are-bullshit/).
6 |
7 | You can view a working demo at [https://www.sethserver.com/unicode-random-password-generator.html](https://www.sethserver.com/unicode-random-password-generator.html)
8 |
9 | It currently uses six unicode blocks, but I don't see any reason why one can't use them all; this just makes the best looking passwords.
10 |
11 | ## Installation
12 |
13 | `npm i javascript-strong-password-generator`
14 |
15 | ## Basic Usage
16 |
17 | This is a quick out-of-the-box usage example. This is not how you'd use it in production if you want it to be secure, but it will give you a decent random unicode password.
18 |
19 | ```javascript
20 | const jsspg = require('javascript-strong-password-generator');
21 |
22 | jsspg.init();
23 | const newPassword = jsspg.generate();
24 |
25 | console.log(newPassword);
26 | ```
27 |
28 | ## Command-line Usage
29 |
30 | JSSPG includes a simple command-line app that will generate a single random password seeded by your local environment.
31 |
32 | ```shell
33 | $ js-spg
34 | ƗÇŒk😪Ư2ëjOåęğ⚎Ŭ☦Ƙ🙅ēňxę😣☨😺Ú
35 | ```
36 |
37 | ## Advanced Usage
38 |
39 | To reduce predictability add entropy from dynamic sytem state inforation such as CPU usage, number of active processes, availalbe ram and disk io.
40 |
41 | ```javascript
42 | const jsspg = require('javascript-strong-password-generator');
43 | const si = require('systeminformation');
44 | const sha512 = require('js-sha512');
45 |
46 | let entropyval;
47 |
48 | function entropyAccumFunction() {
49 | return new Promise(async (resolve) => {
50 | const cpuSpeed = await si.cpu();
51 | const processes = await si.processes();
52 | const disksIO = await si.disksIO();
53 | const memory = await si.mem();
54 |
55 | entropyval = sha512(`${JSON.stringify(cpuSpeed)}:${JSON.stringify(processes)}:${JSON.stringify(disksIO)}:${JSON.stringify(memory)}`);
56 |
57 | resolve();
58 | });
59 | }
60 |
61 | function entropyFunction() {
62 | return entropyval;
63 | }
64 |
65 | async function run() {
66 | await entropyAccumFunction();
67 |
68 | jsspg.init({
69 | timeBasedEntropy: false,
70 | entropyFxn: entropyFunction,
71 | });
72 |
73 | process.stdout.write(`${jsspg.generate()}\n`);
74 | }
75 |
76 | run();
77 | ```
78 |
79 | # Building for Browsers
80 |
81 | This will generate a ./build/jsspg.min.js file for use in a web browser.
82 |
83 | ```shell
84 | $ npm run webpack
85 | ```
86 |
87 | ## Basic Browser Usage
88 |
89 | ```javascript
90 |
91 |
99 | ```
100 |
101 | # Core Concept
102 |
103 | ["Password Rules Are Bullshit"](https://blog.codinghorror.com/password-rules-are-bullshit/).
104 |
105 | ## API
106 |
107 | ### `jsspg.init(options)`
108 |
109 | #### Options [{ k: v }]
110 |
111 | - entropyFxn [function fxn()]: Custom entropy function. Must return an Array or string of length fortuna.entropySz (128 by default)
112 | - timeBasedEntropy [bool]: Detaches the reseeding of the algorithm from the call to random().
113 | - accumulateTimeout [int]: The amount of time in milliseconds between each timeBasedEntropy call. Requires timeBasedEntropy to be true.
114 |
115 | ### `jsspg.generate(passwordLength)`
116 |
117 | Generates a random Unicode password of length `passwordLength` (length is Unicode characters, not bytes).
118 |
--------------------------------------------------------------------------------
/bin/js-spg:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | 'use strict';
4 |
5 | /*
6 | * js-spg: Command line version of Strong Password Generator JS library
7 | *
8 | * (C) 2017 Seth Black
9 | *
10 | */
11 |
12 | process.title = 'js-spg';
13 |
14 | const jsspg = require('../lib/jsspg');
15 | const si = require('systeminformation');
16 | const sha512 = require('js-sha512');
17 |
18 | let entropyval;
19 |
20 | function entropyAccumFunction() {
21 | return new Promise(async (resolve) => {
22 | const cpuSpeed = await si.cpu();
23 | const processes = await si.processes();
24 | const disksIO = await si.disksIO();
25 | const memory = await si.mem();
26 |
27 | entropyval = sha512(`${JSON.stringify(cpuSpeed)}:${JSON.stringify(processes)}:${JSON.stringify(disksIO)}:${JSON.stringify(memory)}`);
28 |
29 | resolve();
30 | });
31 | }
32 |
33 | function entropyFunction() {
34 | return entropyval;
35 | }
36 |
37 | async function run() {
38 | await entropyAccumFunction();
39 |
40 | jsspg.init({
41 | timeBasedEntropy: false,
42 | entropyFxn: entropyFunction,
43 | });
44 |
45 | process.stdout.write(`${jsspg.generate()}\n`);
46 | }
47 |
48 | run();
49 |
--------------------------------------------------------------------------------
/build/jsspg.min.js:
--------------------------------------------------------------------------------
1 | /*! For license information please see jsspg.min.js.LICENSE */
2 | !function(t){function e(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};e.m=t,e.c=i,e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(t,e,i){"use strict";var r=r||function(t,e){var i={},r=i.lib={},n=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var i=new t;return e&&i.mixIn(e),i.hasOwnProperty("init")||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes,n=t.sigBytes;if(this.clamp(),r%4)for(o=0;o>>2]>>>24-o%4*8&255;e[r+o>>>2]|=s<<24-(r+o)%4*8}else if(i.length>65535)for(var o=0;o>>2]=i[o>>>2];else e.push.apply(e,i);return this.sigBytes+=n,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=n.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var i=[],r=0;r>>2]>>>24-n%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new s.init(i,e/2)}},c=o.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],n=0;n>>2]>>>24-n%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new s.init(i,e)}},a=o.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},u=r.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=a.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var i=this._data,r=i.words,n=i.sigBytes,o=this.blockSize,h=n/(4*o),c=(h=e?t.ceil(h):t.max((0|h)-this._minBufferSize,0))*o,a=t.min(4*c,n);if(c){for(var u=0;u>2]|=t[c]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(a[n>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=128?(this.block=a[32],this.start=n-128,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},o.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[32]=this.block,t[e>>2]|=d[3&e],this.block=t[32],e>=112&&(this.hashed||this.hash(),t[0]=this.block,t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=t[16]=t[17]=t[18]=t[19]=t[20]=t[21]=t[22]=t[23]=t[24]=t[25]=t[26]=t[27]=t[28]=t[29]=t[30]=t[31]=t[32]=0),t[30]=this.hBytes<<3|this.bytes>>29,t[31]=this.bytes<<3,this.hash()}},o.prototype.hash=function(){var t,e,i,r,n,s,o,h,c,a,u,f,l,p,y,d,v,m,_,S,b,x,w,B,k,z=this.h0h,E=this.h0l,A=this.h1h,C=this.h1l,O=this.h2h,F=this.h2l,T=this.h3h,D=this.h3l,M=this.h4h,J=this.h4l,U=this.h5h,H=this.h5l,R=this.h6h,j=this.h6l,N=this.h7h,P=this.h7l,I=this.blocks;for(t=32;t<160;t+=2)e=((S=I[t-30])>>>1|(b=I[t-29])<<31)^(S>>>8|b<<24)^S>>>7,i=(b>>>1|S<<31)^(b>>>8|S<<24)^(b>>>7|S<<25),r=((S=I[t-4])>>>19|(b=I[t-3])<<13)^(b>>>29|S<<3)^S>>>6,n=(b>>>19|S<<13)^(S>>>29|b<<3)^(b>>>6|S<<26),S=I[t-32],b=I[t-31],c=((x=I[t-14])>>>16)+(S>>>16)+(e>>>16)+(r>>>16)+((h=(65535&x)+(65535&S)+(65535&e)+(65535&r)+((o=((w=I[t-13])>>>16)+(b>>>16)+(i>>>16)+(n>>>16)+((s=(65535&w)+(65535&b)+(65535&i)+(65535&n))>>>16))>>>16))>>>16),I[t]=c<<16|65535&h,I[t+1]=o<<16|65535&s;var L=z,W=E,X=A,K=C,V=O,Y=F,$=T,q=D,G=M,Q=J,Z=U,tt=H,et=R,it=j,rt=N,nt=P;for(d=X&V,v=K&Y,t=0;t<160;t+=8)e=(L>>>28|W<<4)^(W>>>2|L<<30)^(W>>>7|L<<25),i=(W>>>28|L<<4)^(L>>>2|W<<30)^(L>>>7|W<<25),r=(G>>>14|Q<<18)^(G>>>18|Q<<14)^(Q>>>9|G<<23),n=(Q>>>14|G<<18)^(Q>>>18|G<<14)^(G>>>9|Q<<23),m=(a=L&X)^L&V^d,_=(u=W&K)^W&Y^v,B=G&Z^~G&et,k=Q&tt^~Q&it,S=I[t],b=I[t+1],S=(c=((x=g[t])>>>16)+(S>>>16)+(B>>>16)+(r>>>16)+(rt>>>16)+((h=(65535&x)+(65535&S)+(65535&B)+(65535&r)+(65535&rt)+((o=((w=g[t+1])>>>16)+(b>>>16)+(k>>>16)+(n>>>16)+(nt>>>16)+((s=(65535&w)+(65535&b)+(65535&k)+(65535&n)+(65535&nt))>>>16))>>>16))>>>16))<<16|65535&h,b=o<<16|65535&s,x=(c=(m>>>16)+(e>>>16)+((h=(65535&m)+(65535&e)+((o=(_>>>16)+(i>>>16)+((s=(65535&_)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&h,w=o<<16|65535&s,rt=(c=($>>>16)+(S>>>16)+((h=(65535&$)+(65535&S)+((o=(q>>>16)+(b>>>16)+((s=(65535&q)+(65535&b))>>>16))>>>16))>>>16))<<16|65535&h,nt=o<<16|65535&s,e=(($=(c=(x>>>16)+(S>>>16)+((h=(65535&x)+(65535&S)+((o=(w>>>16)+(b>>>16)+((s=(65535&w)+(65535&b))>>>16))>>>16))>>>16))<<16|65535&h)>>>28|(q=o<<16|65535&s)<<4)^(q>>>2|$<<30)^(q>>>7|$<<25),i=(q>>>28|$<<4)^($>>>2|q<<30)^($>>>7|q<<25),r=(rt>>>14|nt<<18)^(rt>>>18|nt<<14)^(nt>>>9|rt<<23),n=(nt>>>14|rt<<18)^(nt>>>18|rt<<14)^(rt>>>9|nt<<23),m=(f=$&L)^$&X^a,_=(l=q&W)^q&K^u,B=rt&G^~rt&Z,k=nt&Q^~nt&tt,S=I[t+2],b=I[t+3],S=(c=((x=g[t+2])>>>16)+(S>>>16)+(B>>>16)+(r>>>16)+(et>>>16)+((h=(65535&x)+(65535&S)+(65535&B)+(65535&r)+(65535&et)+((o=((w=g[t+3])>>>16)+(b>>>16)+(k>>>16)+(n>>>16)+(it>>>16)+((s=(65535&w)+(65535&b)+(65535&k)+(65535&n)+(65535&it))>>>16))>>>16))>>>16))<<16|65535&h,b=o<<16|65535&s,x=(c=(m>>>16)+(e>>>16)+((h=(65535&m)+(65535&e)+((o=(_>>>16)+(i>>>16)+((s=(65535&_)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&h,w=o<<16|65535&s,et=(c=(V>>>16)+(S>>>16)+((h=(65535&V)+(65535&S)+((o=(Y>>>16)+(b>>>16)+((s=(65535&Y)+(65535&b))>>>16))>>>16))>>>16))<<16|65535&h,it=o<<16|65535&s,e=((V=(c=(x>>>16)+(S>>>16)+((h=(65535&x)+(65535&S)+((o=(w>>>16)+(b>>>16)+((s=(65535&w)+(65535&b))>>>16))>>>16))>>>16))<<16|65535&h)>>>28|(Y=o<<16|65535&s)<<4)^(Y>>>2|V<<30)^(Y>>>7|V<<25),i=(Y>>>28|V<<4)^(V>>>2|Y<<30)^(V>>>7|Y<<25),r=(et>>>14|it<<18)^(et>>>18|it<<14)^(it>>>9|et<<23),n=(it>>>14|et<<18)^(it>>>18|et<<14)^(et>>>9|it<<23),m=(p=V&$)^V&L^f,_=(y=Y&q)^Y&W^l,B=et&rt^~et&G,k=it&nt^~it&Q,S=I[t+4],b=I[t+5],S=(c=((x=g[t+4])>>>16)+(S>>>16)+(B>>>16)+(r>>>16)+(Z>>>16)+((h=(65535&x)+(65535&S)+(65535&B)+(65535&r)+(65535&Z)+((o=((w=g[t+5])>>>16)+(b>>>16)+(k>>>16)+(n>>>16)+(tt>>>16)+((s=(65535&w)+(65535&b)+(65535&k)+(65535&n)+(65535&tt))>>>16))>>>16))>>>16))<<16|65535&h,b=o<<16|65535&s,x=(c=(m>>>16)+(e>>>16)+((h=(65535&m)+(65535&e)+((o=(_>>>16)+(i>>>16)+((s=(65535&_)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&h,w=o<<16|65535&s,Z=(c=(X>>>16)+(S>>>16)+((h=(65535&X)+(65535&S)+((o=(K>>>16)+(b>>>16)+((s=(65535&K)+(65535&b))>>>16))>>>16))>>>16))<<16|65535&h,tt=o<<16|65535&s,e=((X=(c=(x>>>16)+(S>>>16)+((h=(65535&x)+(65535&S)+((o=(w>>>16)+(b>>>16)+((s=(65535&w)+(65535&b))>>>16))>>>16))>>>16))<<16|65535&h)>>>28|(K=o<<16|65535&s)<<4)^(K>>>2|X<<30)^(K>>>7|X<<25),i=(K>>>28|X<<4)^(X>>>2|K<<30)^(X>>>7|K<<25),r=(Z>>>14|tt<<18)^(Z>>>18|tt<<14)^(tt>>>9|Z<<23),n=(tt>>>14|Z<<18)^(tt>>>18|Z<<14)^(Z>>>9|tt<<23),m=(d=X&V)^X&$^p,_=(v=K&Y)^K&q^y,B=Z&et^~Z&rt,k=tt&it^~tt&nt,S=I[t+6],b=I[t+7],S=(c=((x=g[t+6])>>>16)+(S>>>16)+(B>>>16)+(r>>>16)+(G>>>16)+((h=(65535&x)+(65535&S)+(65535&B)+(65535&r)+(65535&G)+((o=((w=g[t+7])>>>16)+(b>>>16)+(k>>>16)+(n>>>16)+(Q>>>16)+((s=(65535&w)+(65535&b)+(65535&k)+(65535&n)+(65535&Q))>>>16))>>>16))>>>16))<<16|65535&h,b=o<<16|65535&s,x=(c=(m>>>16)+(e>>>16)+((h=(65535&m)+(65535&e)+((o=(_>>>16)+(i>>>16)+((s=(65535&_)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&h,w=o<<16|65535&s,G=(c=(L>>>16)+(S>>>16)+((h=(65535&L)+(65535&S)+((o=(W>>>16)+(b>>>16)+((s=(65535&W)+(65535&b))>>>16))>>>16))>>>16))<<16|65535&h,Q=o<<16|65535&s,L=(c=(x>>>16)+(S>>>16)+((h=(65535&x)+(65535&S)+((o=(w>>>16)+(b>>>16)+((s=(65535&w)+(65535&b))>>>16))>>>16))>>>16))<<16|65535&h,W=o<<16|65535&s;c=(z>>>16)+(L>>>16)+((h=(65535&z)+(65535&L)+((o=(E>>>16)+(W>>>16)+((s=(65535&E)+(65535&W))>>>16))>>>16))>>>16),this.h0h=c<<16|65535&h,this.h0l=o<<16|65535&s,c=(A>>>16)+(X>>>16)+((h=(65535&A)+(65535&X)+((o=(C>>>16)+(K>>>16)+((s=(65535&C)+(65535&K))>>>16))>>>16))>>>16),this.h1h=c<<16|65535&h,this.h1l=o<<16|65535&s,c=(O>>>16)+(V>>>16)+((h=(65535&O)+(65535&V)+((o=(F>>>16)+(Y>>>16)+((s=(65535&F)+(65535&Y))>>>16))>>>16))>>>16),this.h2h=c<<16|65535&h,this.h2l=o<<16|65535&s,c=(T>>>16)+($>>>16)+((h=(65535&T)+(65535&$)+((o=(D>>>16)+(q>>>16)+((s=(65535&D)+(65535&q))>>>16))>>>16))>>>16),this.h3h=c<<16|65535&h,this.h3l=o<<16|65535&s,c=(M>>>16)+(G>>>16)+((h=(65535&M)+(65535&G)+((o=(J>>>16)+(Q>>>16)+((s=(65535&J)+(65535&Q))>>>16))>>>16))>>>16),this.h4h=c<<16|65535&h,this.h4l=o<<16|65535&s,c=(U>>>16)+(Z>>>16)+((h=(65535&U)+(65535&Z)+((o=(H>>>16)+(tt>>>16)+((s=(65535&H)+(65535&tt))>>>16))>>>16))>>>16),this.h5h=c<<16|65535&h,this.h5l=o<<16|65535&s,c=(R>>>16)+(et>>>16)+((h=(65535&R)+(65535&et)+((o=(j>>>16)+(it>>>16)+((s=(65535&j)+(65535&it))>>>16))>>>16))>>>16),this.h6h=c<<16|65535&h,this.h6l=o<<16|65535&s,c=(N>>>16)+(rt>>>16)+((h=(65535&N)+(65535&rt)+((o=(P>>>16)+(nt>>>16)+((s=(65535&P)+(65535&nt))>>>16))>>>16))>>>16),this.h7h=c<<16|65535&h,this.h7l=o<<16|65535&s},o.prototype.hex=function(){this.finalize();var t=this.h0h,e=this.h0l,i=this.h1h,r=this.h1l,n=this.h2h,s=this.h2l,o=this.h3h,h=this.h3l,c=this.h4h,a=this.h4l,u=this.h5h,f=this.h5l,l=this.h6h,p=this.h6l,d=this.h7h,v=this.h7l,g=this.bits,m=y[t>>28&15]+y[t>>24&15]+y[t>>20&15]+y[t>>16&15]+y[t>>12&15]+y[t>>8&15]+y[t>>4&15]+y[15&t]+y[e>>28&15]+y[e>>24&15]+y[e>>20&15]+y[e>>16&15]+y[e>>12&15]+y[e>>8&15]+y[e>>4&15]+y[15&e]+y[i>>28&15]+y[i>>24&15]+y[i>>20&15]+y[i>>16&15]+y[i>>12&15]+y[i>>8&15]+y[i>>4&15]+y[15&i]+y[r>>28&15]+y[r>>24&15]+y[r>>20&15]+y[r>>16&15]+y[r>>12&15]+y[r>>8&15]+y[r>>4&15]+y[15&r]+y[n>>28&15]+y[n>>24&15]+y[n>>20&15]+y[n>>16&15]+y[n>>12&15]+y[n>>8&15]+y[n>>4&15]+y[15&n]+y[s>>28&15]+y[s>>24&15]+y[s>>20&15]+y[s>>16&15]+y[s>>12&15]+y[s>>8&15]+y[s>>4&15]+y[15&s]+y[o>>28&15]+y[o>>24&15]+y[o>>20&15]+y[o>>16&15]+y[o>>12&15]+y[o>>8&15]+y[o>>4&15]+y[15&o];return g>=256&&(m+=y[h>>28&15]+y[h>>24&15]+y[h>>20&15]+y[h>>16&15]+y[h>>12&15]+y[h>>8&15]+y[h>>4&15]+y[15&h]),g>=384&&(m+=y[c>>28&15]+y[c>>24&15]+y[c>>20&15]+y[c>>16&15]+y[c>>12&15]+y[c>>8&15]+y[c>>4&15]+y[15&c]+y[a>>28&15]+y[a>>24&15]+y[a>>20&15]+y[a>>16&15]+y[a>>12&15]+y[a>>8&15]+y[a>>4&15]+y[15&a]+y[u>>28&15]+y[u>>24&15]+y[u>>20&15]+y[u>>16&15]+y[u>>12&15]+y[u>>8&15]+y[u>>4&15]+y[15&u]+y[f>>28&15]+y[f>>24&15]+y[f>>20&15]+y[f>>16&15]+y[f>>12&15]+y[f>>8&15]+y[f>>4&15]+y[15&f]),512==g&&(m+=y[l>>28&15]+y[l>>24&15]+y[l>>20&15]+y[l>>16&15]+y[l>>12&15]+y[l>>8&15]+y[l>>4&15]+y[15&l]+y[p>>28&15]+y[p>>24&15]+y[p>>20&15]+y[p>>16&15]+y[p>>12&15]+y[p>>8&15]+y[p>>4&15]+y[15&p]+y[d>>28&15]+y[d>>24&15]+y[d>>20&15]+y[d>>16&15]+y[d>>12&15]+y[d>>8&15]+y[d>>4&15]+y[15&d]+y[v>>28&15]+y[v>>24&15]+y[v>>20&15]+y[v>>16&15]+y[v>>12&15]+y[v>>8&15]+y[v>>4&15]+y[15&v]),m},o.prototype.toString=o.prototype.hex,o.prototype.digest=function(){this.finalize();var t=this.h0h,e=this.h0l,i=this.h1h,r=this.h1l,n=this.h2h,s=this.h2l,o=this.h3h,h=this.h3l,c=this.h4h,a=this.h4l,u=this.h5h,f=this.h5l,l=this.h6h,p=this.h6l,y=this.h7h,d=this.h7l,v=this.bits,g=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o];return v>=256&&g.push(h>>24&255,h>>16&255,h>>8&255,255&h),v>=384&&g.push(c>>24&255,c>>16&255,c>>8&255,255&c,a>>24&255,a>>16&255,a>>8&255,255&a,u>>24&255,u>>16&255,u>>8&255,255&u,f>>24&255,f>>16&255,f>>8&255,255&f),512==v&&g.push(l>>24&255,l>>16&255,l>>8&255,255&l,p>>24&255,p>>16&255,p>>8&255,255&p,y>>24&255,y>>16&255,y>>8&255,255&y,d>>24&255,d>>16&255,d>>8&255,255&d),g},o.prototype.array=o.prototype.digest,o.prototype.arrayBuffer=function(){this.finalize();var t=this.bits,e=new ArrayBuffer(t/8),i=new DataView(e);return i.setUint32(0,this.h0h),i.setUint32(4,this.h0l),i.setUint32(8,this.h1h),i.setUint32(12,this.h1l),i.setUint32(16,this.h2h),i.setUint32(20,this.h2l),i.setUint32(24,this.h3h),t>=256&&i.setUint32(28,this.h3l),t>=384&&(i.setUint32(32,this.h4h),i.setUint32(36,this.h4l),i.setUint32(40,this.h5h),i.setUint32(44,this.h5l)),512==t&&(i.setUint32(48,this.h6h),i.setUint32(52,this.h6l),i.setUint32(56,this.h7h),i.setUint32(60,this.h7l)),e};var x=b(512);x.sha512=x,x.sha384=b(384),x.sha512_256=b(256),x.sha512_224=b(224),f?r.exports=x:(a.sha512=x.sha512,a.sha384=x.sha384,a.sha512_256=x.sha512_256,a.sha512_224=x.sha512_224,l&&void 0!==(n=function(){return x}.call(x,i,x,r))&&(r.exports=n))}()}).call(e,i(4),i(5),i(6)(t))},function(t,e,i){"use strict";var r=i(3),n=i(1),s=i(15),o=e;o.initialized=!1,o.init=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!0!==o.initialized){var e=t.entropyFxn||o.entropyFunction,i=t.timeBasedEntropy||!1,n=t.accumulateTimeout||0;r.init({timeBasedEntropy:i,accumulateTimeout:n,entropyFxn:e}),o.initialized=!0}},o.entropyFunction=function(){return n(""+(new Date).getTime())},o.rng=function(t,e){return parseInt(r.random()*(e-t)+t,10)},o.generate=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:26,e="",i=0;i0&&void 0!==arguments[0]?arguments[0]:{};if(!0!==o.initialized){o.key=null,o.entropy=null,o.counter=0,o.entropySz=128,o.currentTimer=null,o.timeBasedEntropy=t.timeBasedEntropy||!1,o.accumulateTimeout=t.accumulateTimeout||375,o.entropyFxn=t.entropyFxn||o.timeBasedEntropyFxn;var e=o.entropyFxn();if(Array.isArray(e)&&e.length!==o.entropySz)throw new o.EntropyException("entropyFxn did not return an array of length "+o.entropySz+".");if("string"==typeof e&&e.length!==o.entropySz)throw new o.EntropyException("entropyFxn did not return a string of length "+o.entropySz+".");if("string"!=typeof e&&!1===Array.isArray(e))throw new o.EntropyException("entropyFxn needs to return either a string or array of length "+o.entropySz+" but you gave me "+(void 0===e?"undefined":r(e))+" of length "+e.length+".");o.accumulate(),o.seed(),o.initialized=!0}},o.EntropyException=function(t){this.message=t,this.name="EntropyException"},o.ConversionException=function(t){this.message=t,this.name="ConversionException"},o.timeBasedEntropyFxn=function(){return n(""+(new Date).getTime())},o.accumulate=function(){o.entropy=o.entropyFxn(),!0===o.timeBasedEntropy&&(o.currentTimer=setTimeout(o.accumulate,o.accumulateTimeout))},o.stopTimer=function(){o.timeBasedEntropy=!1,null!==o.currentTimer&&clearTimeout(o.currentTimer)},o.seed=function(){var t="";if(Array.isArray(o.entropy))for(var e=0;e>>0},o.int53=function(){var t=0|o.generate();return 4294967296*(2097151&t)+(o.generate()>>>0)+(2097152&t?-9007199254740992:0)},o.int53Full=function(){for(;;){var t=0|o.generate();if(!(4194304&t)){return 4294967296*(2097151&t)+(o.generate()>>>0)+(2097152&t?-9007199254740992:0)}if(4194304==(8388607&t)&&0==(0|o.generate()))return 9007199254740992}},o.uint53=function(){return 4294967296*(2097151&o.generate())+(o.generate()>>>0)},o.uint53Full=function(){for(;;){var t=0|o.generate();if(!(2097152&t)){return 4294967296*(2097151&t)+(o.generate()>>>0)}if(2097152==(4194303&t)&&0==(0|o.generate()))return 9007199254740992}},o.random=function(){return o.uint53Full()/9007199254740992},"undefined"!=typeof window&&(window.fortuna=o)},function(t,e,i){"use strict";function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function s(t){if(u===setTimeout)return setTimeout(t,0);if((u===r||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function o(){d&&p&&(d=!1,p.length?y=p.concat(y):v=-1,y.length&&h())}function h(){if(!d){var t=s(o);d=!0;for(var e=y.length;e;){for(p=y,y=[];++v1)for(var i=1;i>>2]>>>24-s%4*8&255)<<16|(e[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|e[s+2>>>2]>>>24-(s+2)%4*8&255,h=0;h<4&&s+.75*h>>6*(3-h)&63));var c=r.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(t){var i=t.length,r=this._map,n=r.charAt(64);if(n){var s=t.indexOf(n);-1!=s&&(i=s)}for(var o=[],h=0,c=0;c>>6-c%4*2;o[h>>>2]|=(a|u)<<24-h%4*8,h++}return e.create(o,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}()},function(t,e,i){"use strict";var r=i(0).CryptoJS;!function(t){function e(t,e,i,r,n,s,o){var h=t+(e&i|~e&r)+n+o;return(h<>>32-s)+e}function i(t,e,i,r,n,s,o){var h=t+(e&r|i&~r)+n+o;return(h<>>32-s)+e}function n(t,e,i,r,n,s,o){var h=t+(e^i^r)+n+o;return(h<>>32-s)+e}function s(t,e,i,r,n,s,o){var h=t+(i^(e|~r))+n+o;return(h<>>32-s)+e}var o=r,h=o.lib,c=h.WordArray,a=h.Hasher,u=o.algo,f=[];!function(){for(var e=0;e<64;e++)f[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=u.MD5=a.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,r){for(var o=0;o<16;o++){var h=r+o,c=t[h];t[h]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var a=this._hash.words,u=t[r+0],l=t[r+1],p=t[r+2],y=t[r+3],d=t[r+4],v=t[r+5],g=t[r+6],m=t[r+7],_=t[r+8],S=t[r+9],b=t[r+10],x=t[r+11],w=t[r+12],B=t[r+13],k=t[r+14],z=t[r+15],E=a[0],A=a[1],C=a[2],O=a[3];A=s(A=s(A=s(A=s(A=n(A=n(A=n(A=n(A=i(A=i(A=i(A=i(A=e(A=e(A=e(A=e(A,C=e(C,O=e(O,E=e(E,A,C,O,u,7,f[0]),A,C,l,12,f[1]),E,A,p,17,f[2]),O,E,y,22,f[3]),C=e(C,O=e(O,E=e(E,A,C,O,d,7,f[4]),A,C,v,12,f[5]),E,A,g,17,f[6]),O,E,m,22,f[7]),C=e(C,O=e(O,E=e(E,A,C,O,_,7,f[8]),A,C,S,12,f[9]),E,A,b,17,f[10]),O,E,x,22,f[11]),C=e(C,O=e(O,E=e(E,A,C,O,w,7,f[12]),A,C,B,12,f[13]),E,A,k,17,f[14]),O,E,z,22,f[15]),C=i(C,O=i(O,E=i(E,A,C,O,l,5,f[16]),A,C,g,9,f[17]),E,A,x,14,f[18]),O,E,u,20,f[19]),C=i(C,O=i(O,E=i(E,A,C,O,v,5,f[20]),A,C,b,9,f[21]),E,A,z,14,f[22]),O,E,d,20,f[23]),C=i(C,O=i(O,E=i(E,A,C,O,S,5,f[24]),A,C,k,9,f[25]),E,A,y,14,f[26]),O,E,_,20,f[27]),C=i(C,O=i(O,E=i(E,A,C,O,B,5,f[28]),A,C,p,9,f[29]),E,A,m,14,f[30]),O,E,w,20,f[31]),C=n(C,O=n(O,E=n(E,A,C,O,v,4,f[32]),A,C,_,11,f[33]),E,A,x,16,f[34]),O,E,k,23,f[35]),C=n(C,O=n(O,E=n(E,A,C,O,l,4,f[36]),A,C,d,11,f[37]),E,A,m,16,f[38]),O,E,b,23,f[39]),C=n(C,O=n(O,E=n(E,A,C,O,B,4,f[40]),A,C,u,11,f[41]),E,A,y,16,f[42]),O,E,g,23,f[43]),C=n(C,O=n(O,E=n(E,A,C,O,S,4,f[44]),A,C,w,11,f[45]),E,A,z,16,f[46]),O,E,p,23,f[47]),C=s(C,O=s(O,E=s(E,A,C,O,u,6,f[48]),A,C,m,10,f[49]),E,A,k,15,f[50]),O,E,v,21,f[51]),C=s(C,O=s(O,E=s(E,A,C,O,w,6,f[52]),A,C,y,10,f[53]),E,A,b,15,f[54]),O,E,l,21,f[55]),C=s(C,O=s(O,E=s(E,A,C,O,_,6,f[56]),A,C,z,10,f[57]),E,A,g,15,f[58]),O,E,B,21,f[59]),C=s(C,O=s(O,E=s(E,A,C,O,d,6,f[60]),A,C,x,10,f[61]),E,A,p,15,f[62]),O,E,S,21,f[63]),a[0]=a[0]+E|0,a[1]=a[1]+A|0,a[2]=a[2]+C|0,a[3]=a[3]+O|0},_doFinalize:function(){var e=this._data,i=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;i[n>>>5]|=128<<24-n%32;var s=t.floor(r/4294967296),o=r;i[15+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),i[14+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(i.length+1),this._process();for(var h=this._hash,c=h.words,a=0;a<4;a++){var u=c[a];c[a]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return h},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}});o.MD5=a._createHelper(l),o.HmacMD5=a._createHmacHelper(l)}(Math)},function(t,e,i){"use strict";var r=i(0).CryptoJS;!function(){var t=r,e=t.lib,i=e.Base,n=e.WordArray,s=t.algo,o=s.MD5,h=s.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:o,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var i=this.cfg,r=i.hasher.create(),s=n.create(),o=s.words,h=i.keySize,c=i.iterations;o.length>>2];t.sigBytes-=e}},d=(i.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:y}),reset:function(){u.reset.call(this);var t=this.cfg,e=t.iv,i=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)r=i.createEncryptor;else{var r=i.createDecryptor;this._minBufferSize=1}this._mode=r.call(i,this,e&&e.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),i.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),v=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;if(i)r=s.create([1398893684,1701076831]).concat(i).concat(e);else var r=e;return r.toString(c)},parse:function(t){var e=c.parse(t),i=e.words;if(1398893684==i[0]&&1701076831==i[1]){var r=s.create(i.slice(2,4));i.splice(0,4),e.sigBytes-=16}return d.create({ciphertext:e,salt:r})}},g=i.SerializableCipher=n.extend({cfg:n.extend({format:v}),encrypt:function(t,e,i,r){r=this.cfg.extend(r);var n=t.createEncryptor(i,r),s=n.finalize(e),o=n.cfg;return d.create({ciphertext:s,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,i,r){r=this.cfg.extend(r),e=this._parse(e,r.format);return t.createDecryptor(i,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),m=(e.kdf={}).OpenSSL={execute:function(t,e,i,r){r||(r=s.random(8));var n=a.create({keySize:e+i}).compute(t,r),o=s.create(n.words.slice(e),4*i);return n.sigBytes=4*e,d.create({key:n,iv:o,salt:r})}},_=i.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:m}),encrypt:function(t,e,i,r){var n=(r=this.cfg.extend(r)).kdf.execute(i,t.keySize,t.ivSize);r.iv=n.iv;var s=g.encrypt.call(this,t,e,n.key,r);return s.mixIn(n),s},decrypt:function(t,e,i,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var n=r.kdf.execute(i,t.keySize,t.ivSize,e.salt);r.iv=n.iv;return g.decrypt.call(this,t,e,n.key,r)}})}()},function(t,e,i){"use strict";var r=i(0).CryptoJS;!function(){var t=r,e=t.lib.BlockCipher,i=t.algo,n=[],s=[],o=[],h=[],c=[],a=[],u=[],f=[],l=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var i=0,r=0,e=0;e<256;e++){var y=r^r<<1^r<<2^r<<3^r<<4;y=y>>>8^255&y^99,n[i]=y,s[y]=i;var d=t[i],v=t[d],g=t[v],m=257*t[y]^16843008*y;o[i]=m<<24|m>>>8,h[i]=m<<16|m>>>16,c[i]=m<<8|m>>>24,a[i]=m;m=16843009*g^65537*v^257*d^16843008*i;u[y]=m<<24|m>>>8,f[y]=m<<16|m>>>16,l[y]=m<<8|m>>>24,p[y]=m,i?(i=d^t[t[t[g^d]]],r^=t[t[r]]):i=r=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],d=i.AES=e.extend({_doReset:function(){for(var t=this._key,e=t.words,i=t.sigBytes/4,r=4*((this._nRounds=i+6)+1),s=this._keySchedule=[],o=0;o6&&o%i==4&&(a=n[a>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a]):(a=n[(a=a<<8|a>>>24)>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a],a^=y[o/i|0]<<24),s[o]=s[o-i]^a}for(var h=this._invKeySchedule=[],c=0;c>>24]]^f[n[a>>>16&255]]^l[n[a>>>8&255]]^p[n[255&a]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,h,c,a,n)},decryptBlock:function(t,e){i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this._doCryptBlock(t,e,this._invKeySchedule,u,f,l,p,s);var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i},_doCryptBlock:function(t,e,i,r,n,s,o,h){for(var c=this._nRounds,a=t[e]^i[0],u=t[e+1]^i[1],f=t[e+2]^i[2],l=t[e+3]^i[3],p=4,y=1;y>>24]^n[u>>>16&255]^s[f>>>8&255]^o[255&l]^i[p++],v=r[u>>>24]^n[f>>>16&255]^s[l>>>8&255]^o[255&a]^i[p++],g=r[f>>>24]^n[l>>>16&255]^s[a>>>8&255]^o[255&u]^i[p++],m=r[l>>>24]^n[a>>>16&255]^s[u>>>8&255]^o[255&f]^i[p++];a=d,u=v,f=g,l=m}var d=(h[a>>>24]<<24|h[u>>>16&255]<<16|h[f>>>8&255]<<8|h[255&l])^i[p++],v=(h[u>>>24]<<24|h[f>>>16&255]<<16|h[l>>>8&255]<<8|h[255&a])^i[p++],g=(h[f>>>24]<<24|h[l>>>16&255]<<16|h[a>>>8&255]<<8|h[255&u])^i[p++],m=(h[l>>>24]<<24|h[a>>>16&255]<<16|h[u>>>8&255]<<8|h[255&f])^i[p++];t[e]=d,t[e+1]=v,t[e+2]=g,t[e+3]=m},keySize:8});t.AES=e._createHelper(d)}()},function(t,e,i){"use strict";var r=i(0).CryptoJS,n={stringify:function(t){var e={ct:t.ciphertext.toString(r.enc.Base64)};return t.iv&&(e.iv=t.iv.toString()),t.salt&&(e.s=t.salt.toString()),JSON.stringify(e)},parse:function(t){var e=JSON.parse(t),i=r.lib.CipherParams.create({ciphertext:r.enc.Base64.parse(e.ct)});return e.iv&&(i.iv=r.enc.Hex.parse(e.iv)),e.s&&(i.salt=r.enc.Hex.parse(e.s)),i}};e.JsonFormatter=n},function(t,e,i){"use strict";e.blocks=[["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],["¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ"],["Ā","ā","Ă","ă","Ą","ą","Ć","ć","Ĉ","ĉ","Ċ","ċ","Č","č","Ď","ď","Đ","đ","Ē","ē","Ĕ","ĕ","Ė","ė","Ę","ę","Ě","ě","Ĝ","ĝ","Ğ","ğ","Ġ","ġ","Ģ","ģ","Ĥ","ĥ","Ħ","ħ","Ĩ","ĩ","Ī","ī","Ĭ","ĭ","Į","į","İ","ı","IJ","ij","Ĵ","ĵ","Ķ","ķ","ĸ","Ĺ","ĺ","Ļ","ļ","Ľ","ľ","Ŀ","ŀ","Ł","ł","Ń","ń","Ņ","ņ","Ň","ň","ʼn","Ŋ","ŋ","Ō","ō","Ŏ","ŏ","Ő","ő","Œ","œ","Ŕ","ŕ","Ŗ","ŗ","Ř","ř","Ś","ś","Ŝ","ŝ","Ş","ş","Š","š","Ţ","ţ","Ť","ť","Ŧ","ŧ","Ũ","ũ","Ū","ū","Ŭ","ŭ","Ů","ů","Ű","ű","Ų","ų","Ŵ","ŵ","Ŷ","ŷ","Ÿ","Ź","ź","Ż","ż","Ž","ž","ſ"],["ƀ","Ɓ","Ƃ","ƃ","Ƅ","ƅ","Ɔ","Ƈ","ƈ","Ɖ","Ɗ","Ƌ","ƌ","ƍ","Ǝ","Ə","Ɛ","Ƒ","ƒ","Ɠ","Ɣ","ƕ","Ɩ","Ɨ","Ƙ","ƙ","ƚ","ƛ","Ɯ","Ɲ","ƞ","Ɵ","Ơ","ơ","Ƣ","ƣ","Ƥ","ƥ","Ʀ","Ƨ","ƨ","Ʃ","ƪ","ƫ","Ƭ","ƭ","Ʈ","Ư","ư","Ʊ","Ʋ","Ƴ","ƴ","Ƶ","ƶ","Ʒ","Ƹ","ƹ","ƺ","ƻ","Ƽ","ƽ","ƾ","ƿ","ǀ","ǁ","ǂ","ǃ","DŽ","Dž","dž","LJ","Lj","lj","NJ","Nj","nj","Ǎ","ǎ","Ǐ","ǐ","Ǒ","ǒ","Ǔ","ǔ","Ǖ","ǖ","Ǘ","ǘ","Ǚ","ǚ","Ǜ","ǜ","ǝ","Ǟ","ǟ","Ǡ","ǡ","Ǣ","ǣ","Ǥ","ǥ","Ǧ","ǧ","Ǩ","ǩ","Ǫ","ǫ","Ǭ","ǭ","Ǯ","ǯ","ǰ","DZ","Dz","dz","Ǵ","ǵ","Ƕ","Ƿ","Ǹ","ǹ","Ǻ","ǻ","Ǽ","ǽ","Ǿ","ǿ","Ȁ","ȁ","Ȃ","ȃ","Ȅ","ȅ","Ȇ","ȇ","Ȉ","ȉ","Ȋ","ȋ","Ȍ","ȍ","Ȏ","ȏ","Ȑ","ȑ","Ȓ","ȓ","Ȕ","ȕ","Ȗ","ȗ","Ș","ș","Ț","ț","Ȝ","ȝ","Ȟ","ȟ","Ƞ","ȡ","Ȣ","ȣ","Ȥ","ȥ","Ȧ","ȧ","Ȩ","ȩ","Ȫ","ȫ","Ȭ","ȭ","Ȯ","ȯ","Ȱ","ȱ","Ȳ","ȳ","ȴ","ȵ","ȶ","ȷ","ȸ","ȹ","Ⱥ","Ȼ","ȼ","Ƚ","Ⱦ","ȿ","ɀ","Ɂ","ɂ","Ƀ","Ʉ","Ʌ","Ɇ","ɇ","Ɉ","ɉ","Ɋ","ɋ","Ɍ","ɍ","Ɏ","ɏ"],["☀","☁","☂","☃","☄","★","☆","☇","☈","☉","☊","☋","☌","☍","☎","☏","☐","☑","☒","☓","☔","☕","☖","☗","☘","☙","☚","☛","☜","☝","☞","☟","☠","☡","☢","☣","☤","☥","☦","☧","☨","☩","☪","☫","☬","☭","☮","☯","☰","☱","☲","☳","☴","☵","☶","☷","☸","☹","☺","☻","☼","☽","☾","☿","♀","♁","♂","♃","♄","♅","♆","♇","♈","♉","♊","♋","♌","♍","♎","♏","♐","♑","♒","♓","♔","♕","♖","♗","♘","♙","♚","♛","♜","♝","♞","♟","♠","♡","♢","♣","♤","♥","♦","♧","♨","♩","♪","♫","♬","♭","♮","♯","♰","♱","♲","♳","♴","♵","♶","♷","♸","♹","♺","♻","♼","♽","♾","♿","⚀","⚁","⚂","⚃","⚄","⚅","⚆","⚇","⚈","⚉","⚊","⚋","⚌","⚍","⚎","⚏","⚐","⚑","⚒","⚓","⚔","⚕","⚖","⚗","⚘","⚙"],["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😯","😰","😱","😲","😳","😴","😵","😶","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙁","🙂","🙃","🙄","🙅","🙆","🙇","🙈","🙉","🙊","🙋","🙌","🙍","🙎","🙏"]]}]);
11 | //# sourceMappingURL=jsspg.min.js.map
--------------------------------------------------------------------------------
/lib/jsspg.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jsspg.js: Strong Password Generator
3 | *
4 | * (C) 2017 Seth Black
5 | *
6 | */
7 |
8 | const fortuna = require('javascript-fortuna');
9 | const sha512 = require('js-sha512');
10 | const unicodeBlocks = require('./unicodeBlocks');
11 |
12 | const jsspg = exports;
13 |
14 | jsspg.initialized = false;
15 |
16 | jsspg.init = (options = {}) => {
17 | if (jsspg.initialized === true) {
18 | return;
19 | }
20 |
21 | const entropyFxn = options.entropyFxn || jsspg.entropyFunction;
22 | const timeBasedEntropy = options.timeBasedEntropy || false;
23 | const accumulateTimeout = options.accumulateTimeout || 0;
24 |
25 | fortuna.init({
26 | timeBasedEntropy,
27 | accumulateTimeout,
28 | entropyFxn,
29 | });
30 |
31 | jsspg.initialized = true;
32 | };
33 |
34 | jsspg.entropyFunction = () => sha512(`${(new Date()).getTime()}`);
35 |
36 | jsspg.rng = (min, max) => parseInt((fortuna.random() * (max - min)) + min, 10);
37 |
38 | jsspg.generate = (passwordLength = 26) => {
39 | let newPassword = '';
40 |
41 | for (let x = 0; x < passwordLength; x += 1) {
42 | const block = jsspg.rng(0, unicodeBlocks.blocks.length);
43 | const randomPos = jsspg.rng(0, unicodeBlocks.blocks[block].length);
44 | const charCode = unicodeBlocks.blocks[block][randomPos];
45 | newPassword += charCode;
46 | }
47 |
48 | return newPassword;
49 | };
50 |
51 | if (typeof window !== 'undefined') {
52 | window.jsspg = jsspg;
53 | }
54 |
--------------------------------------------------------------------------------
/lib/unicodeBlocks.js:
--------------------------------------------------------------------------------
1 | /*
2 | * unocode_blocks.js: Strong Password Generator
3 | *
4 | * (C) 2017 Seth Black
5 | *
6 | */
7 |
8 | const unicodeBlocks = exports;
9 |
10 | unicodeBlocks.blocks = [
11 | [
12 | '\u0021','\u0022','\u0023','\u0024',
13 | '\u0025','\u0026','\u0027','\u0028',
14 | '\u0029','\u002A','\u002B','\u002C',
15 | '\u002D','\u002E','\u002F','\u0030',
16 | '\u0031','\u0032','\u0033','\u0034',
17 | '\u0035','\u0036','\u0037','\u0038',
18 | '\u0039','\u003A','\u003B','\u003C',
19 | '\u003D','\u003E','\u003F','\u0040',
20 | '\u0041','\u0042','\u0043','\u0044',
21 | '\u0045','\u0046','\u0047','\u0048',
22 | '\u0049','\u004A','\u004B','\u004C',
23 | '\u004D','\u004E','\u004F','\u0050',
24 | '\u0051','\u0052','\u0053','\u0054',
25 | '\u0055','\u0056','\u0057','\u0058',
26 | '\u0059','\u005A','\u005B','\u005C',
27 | '\u005D','\u005E','\u005F','\u0060',
28 | '\u0061','\u0062','\u0063','\u0064',
29 | '\u0065','\u0066','\u0067','\u0068',
30 | '\u0069','\u006A','\u006B','\u006C',
31 | '\u006D','\u006E','\u006F','\u0070',
32 | '\u0071','\u0072','\u0073','\u0074',
33 | '\u0075','\u0076','\u0077','\u0078',
34 | '\u0079','\u007A','\u007B','\u007C',
35 | '\u007D','\u007E'],
36 | [
37 | '\u00A1','\u00A2','\u00A3','\u00A4',
38 | '\u00A5','\u00A6','\u00A7','\u00A8',
39 | '\u00A9','\u00AA','\u00AB','\u00AC',
40 | '\u00AD','\u00AE','\u00AF','\u00B0',
41 | '\u00B1','\u00B2','\u00B3','\u00B4',
42 | '\u00B5','\u00B6','\u00B7','\u00B8',
43 | '\u00B9','\u00BA','\u00BB','\u00BC',
44 | '\u00BD','\u00BE','\u00BF','\u00C0',
45 | '\u00C1','\u00C2','\u00C3','\u00C4',
46 | '\u00C5','\u00C6','\u00C7','\u00C8',
47 | '\u00C9','\u00CA','\u00CB','\u00CC',
48 | '\u00CD','\u00CE','\u00CF','\u00D0',
49 | '\u00D1','\u00D2','\u00D3','\u00D4',
50 | '\u00D5','\u00D6','\u00D7','\u00D8',
51 | '\u00D9','\u00DA','\u00DB','\u00DC',
52 | '\u00DD','\u00DE','\u00DF','\u00E0',
53 | '\u00E1','\u00E2','\u00E3','\u00E4',
54 | '\u00E5','\u00E6','\u00E7','\u00E8',
55 | '\u00E9','\u00EA','\u00EB','\u00EC',
56 | '\u00ED','\u00EE','\u00EF','\u00F0',
57 | '\u00F1','\u00F2','\u00F3','\u00F4',
58 | '\u00F5','\u00F6','\u00F7','\u00F8',
59 | '\u00F9','\u00FA','\u00FB','\u00FC',
60 | '\u00FD','\u00FE','\u00FF'],
61 | [
62 | '\u0100','\u0101','\u0102','\u0103',
63 | '\u0104','\u0105','\u0106','\u0107',
64 | '\u0108','\u0109','\u010A','\u010B',
65 | '\u010C','\u010D','\u010E','\u010F',
66 | '\u0110','\u0111','\u0112','\u0113',
67 | '\u0114','\u0115','\u0116','\u0117',
68 | '\u0118','\u0119','\u011A','\u011B',
69 | '\u011C','\u011D','\u011E','\u011F',
70 | '\u0120','\u0121','\u0122','\u0123',
71 | '\u0124','\u0125','\u0126','\u0127',
72 | '\u0128','\u0129','\u012A','\u012B',
73 | '\u012C','\u012D','\u012E','\u012F',
74 | '\u0130','\u0131','\u0132','\u0133',
75 | '\u0134','\u0135','\u0136','\u0137',
76 | '\u0138','\u0139','\u013A','\u013B',
77 | '\u013C','\u013D','\u013E','\u013F',
78 | '\u0140','\u0141','\u0142','\u0143',
79 | '\u0144','\u0145','\u0146','\u0147',
80 | '\u0148','\u0149','\u014A','\u014B',
81 | '\u014C','\u014D','\u014E','\u014F',
82 | '\u0150','\u0151','\u0152','\u0153',
83 | '\u0154','\u0155','\u0156','\u0157',
84 | '\u0158','\u0159','\u015A','\u015B',
85 | '\u015C','\u015D','\u015E','\u015F',
86 | '\u0160','\u0161','\u0162','\u0163',
87 | '\u0164','\u0165','\u0166','\u0167',
88 | '\u0168','\u0169','\u016A','\u016B',
89 | '\u016C','\u016D','\u016E','\u016F',
90 | '\u0170','\u0171','\u0172','\u0173',
91 | '\u0174','\u0175','\u0176','\u0177',
92 | '\u0178','\u0179','\u017A','\u017B',
93 | '\u017C','\u017D','\u017E','\u017F'],
94 | [
95 | '\u0180','\u0181','\u0182','\u0183',
96 | '\u0184','\u0185','\u0186','\u0187',
97 | '\u0188','\u0189','\u018A','\u018B',
98 | '\u018C','\u018D','\u018E','\u018F',
99 | '\u0190','\u0191','\u0192','\u0193',
100 | '\u0194','\u0195','\u0196','\u0197',
101 | '\u0198','\u0199','\u019A','\u019B',
102 | '\u019C','\u019D','\u019E','\u019F',
103 | '\u01A0','\u01A1','\u01A2','\u01A3',
104 | '\u01A4','\u01A5','\u01A6','\u01A7',
105 | '\u01A8','\u01A9','\u01AA','\u01AB',
106 | '\u01AC','\u01AD','\u01AE','\u01AF',
107 | '\u01B0','\u01B1','\u01B2','\u01B3',
108 | '\u01B4','\u01B5','\u01B6','\u01B7',
109 | '\u01B8','\u01B9','\u01BA','\u01BB',
110 | '\u01BC','\u01BD','\u01BE','\u01BF',
111 | '\u01C0','\u01C1','\u01C2','\u01C3',
112 | '\u01C4','\u01C5','\u01C6','\u01C7',
113 | '\u01C8','\u01C9','\u01CA','\u01CB',
114 | '\u01CC','\u01CD','\u01CE','\u01CF',
115 | '\u01D0','\u01D1','\u01D2','\u01D3',
116 | '\u01D4','\u01D5','\u01D6','\u01D7',
117 | '\u01D8','\u01D9','\u01DA','\u01DB',
118 | '\u01DC','\u01DD','\u01DE','\u01DF',
119 | '\u01E0','\u01E1','\u01E2','\u01E3',
120 | '\u01E4','\u01E5','\u01E6','\u01E7',
121 | '\u01E8','\u01E9','\u01EA','\u01EB',
122 | '\u01EC','\u01ED','\u01EE','\u01EF',
123 | '\u01F0','\u01F1','\u01F2','\u01F3',
124 | '\u01F4','\u01F5','\u01F6','\u01F7',
125 | '\u01F8','\u01F9','\u01FA','\u01FB',
126 | '\u01FC','\u01FD','\u01FE','\u01FF',
127 | '\u0200','\u0201','\u0202','\u0203',
128 | '\u0204','\u0205','\u0206','\u0207',
129 | '\u0208','\u0209','\u020A','\u020B',
130 | '\u020C','\u020D','\u020E','\u020F',
131 | '\u0210','\u0211','\u0212','\u0213',
132 | '\u0214','\u0215','\u0216','\u0217',
133 | '\u0218','\u0219','\u021A','\u021B',
134 | '\u021C','\u021D','\u021E','\u021F',
135 | '\u0220','\u0221','\u0222','\u0223',
136 | '\u0224','\u0225','\u0226','\u0227',
137 | '\u0228','\u0229','\u022A','\u022B',
138 | '\u022C','\u022D','\u022E','\u022F',
139 | '\u0230','\u0231','\u0232','\u0233',
140 | '\u0234','\u0235','\u0236','\u0237',
141 | '\u0238','\u0239','\u023A','\u023B',
142 | '\u023C','\u023D','\u023E','\u023F',
143 | '\u0240','\u0241','\u0242','\u0243',
144 | '\u0244','\u0245','\u0246','\u0247',
145 | '\u0248','\u0249','\u024A','\u024B',
146 | '\u024C','\u024D','\u024E','\u024F'],
147 | [
148 | '\u2600','\u2601','\u2602','\u2603',
149 | '\u2604','\u2605','\u2606','\u2607',
150 | '\u2608','\u2609','\u260A','\u260B',
151 | '\u260C','\u260D','\u260E','\u260F',
152 | '\u2610','\u2611','\u2612','\u2613',
153 | '\u2614','\u2615','\u2616','\u2617',
154 | '\u2618','\u2619','\u261A','\u261B',
155 | '\u261C','\u261D','\u261E','\u261F',
156 | '\u2620','\u2621','\u2622','\u2623',
157 | '\u2624','\u2625','\u2626','\u2627',
158 | '\u2628','\u2629','\u262A','\u262B',
159 | '\u262C','\u262D','\u262E','\u262F',
160 | '\u2630','\u2631','\u2632','\u2633',
161 | '\u2634','\u2635','\u2636','\u2637',
162 | '\u2638','\u2639','\u263A','\u263B',
163 | '\u263C','\u263D','\u263E','\u263F',
164 | '\u2640','\u2641','\u2642','\u2643',
165 | '\u2644','\u2645','\u2646','\u2647',
166 | '\u2648','\u2649','\u264A','\u264B',
167 | '\u264C','\u264D','\u264E','\u264F',
168 | '\u2650','\u2651','\u2652','\u2653',
169 | '\u2654','\u2655','\u2656','\u2657',
170 | '\u2658','\u2659','\u265A','\u265B',
171 | '\u265C','\u265D','\u265E','\u265F',
172 | '\u2660','\u2661','\u2662','\u2663',
173 | '\u2664','\u2665','\u2666','\u2667',
174 | '\u2668','\u2669','\u266A','\u266B',
175 | '\u266C','\u266D','\u266E','\u266F',
176 | '\u2670','\u2671','\u2672','\u2673',
177 | '\u2674','\u2675','\u2676','\u2677',
178 | '\u2678','\u2679','\u267A','\u267B',
179 | '\u267C','\u267D','\u267E','\u267F',
180 | '\u2680','\u2681','\u2682','\u2683',
181 | '\u2684','\u2685','\u2686','\u2687',
182 | '\u2688','\u2689','\u268A','\u268B',
183 | '\u268C','\u268D','\u268E','\u268F',
184 | '\u2690','\u2691','\u2692','\u2693',
185 | '\u2694','\u2695','\u2696','\u2697',
186 | '\u2698','\u2699'],
187 | [
188 | '\uD83D\uDE00','\uD83D\uDE01','\uD83D\uDE02','\uD83D\uDE03',
189 | '\uD83D\uDE04','\uD83D\uDE05','\uD83D\uDE06','\uD83D\uDE07',
190 | '\uD83D\uDE08','\uD83D\uDE09','\uD83D\uDE0A','\uD83D\uDE0B',
191 | '\uD83D\uDE0C','\uD83D\uDE0D','\uD83D\uDE0E','\uD83D\uDE0F',
192 | '\uD83D\uDE10','\uD83D\uDE11','\uD83D\uDE12','\uD83D\uDE13',
193 | '\uD83D\uDE14','\uD83D\uDE15','\uD83D\uDE16','\uD83D\uDE17',
194 | '\uD83D\uDE18','\uD83D\uDE19','\uD83D\uDE1A','\uD83D\uDE1B',
195 | '\uD83D\uDE1C','\uD83D\uDE1D','\uD83D\uDE1E','\uD83D\uDE1F',
196 | '\uD83D\uDE20','\uD83D\uDE21','\uD83D\uDE22','\uD83D\uDE23',
197 | '\uD83D\uDE24','\uD83D\uDE25','\uD83D\uDE26','\uD83D\uDE27',
198 | '\uD83D\uDE28','\uD83D\uDE29','\uD83D\uDE2A','\uD83D\uDE2B',
199 | '\uD83D\uDE2C','\uD83D\uDE2D','\uD83D\uDE2E','\uD83D\uDE2F',
200 | '\uD83D\uDE30','\uD83D\uDE31','\uD83D\uDE32','\uD83D\uDE33',
201 | '\uD83D\uDE34','\uD83D\uDE35','\uD83D\uDE36','\uD83D\uDE37',
202 | '\uD83D\uDE38','\uD83D\uDE39','\uD83D\uDE3A','\uD83D\uDE3B',
203 | '\uD83D\uDE3C','\uD83D\uDE3D','\uD83D\uDE3E','\uD83D\uDE3F',
204 | '\uD83D\uDE40','\uD83D\uDE41','\uD83D\uDE42','\uD83D\uDE43',
205 | '\uD83D\uDE44','\uD83D\uDE45','\uD83D\uDE46','\uD83D\uDE47',
206 | '\uD83D\uDE48','\uD83D\uDE49','\uD83D\uDE4A','\uD83D\uDE4B',
207 | '\uD83D\uDE4C','\uD83D\uDE4D','\uD83D\uDE4E','\uD83D\uDE4F']
208 | ];
209 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "javascript-strong-password-generator",
3 | "version": "1.0.2",
4 | "description": "Strong Password Generator using Fortuna",
5 | "main": "lib/jsspg.js",
6 | "scripts": {
7 | "babel": "babel lib -d build --presets env",
8 | "test": "mocha",
9 | "webpack": "webpack"
10 | },
11 | "repository": {
12 | "type": "git",
13 | "url": "git+https://github.com/sethblack/javascript-strong-password-generator.git"
14 | },
15 | "keywords": [
16 | "strong",
17 | "password",
18 | "generator"
19 | ],
20 | "author": "Seth Black (https://www.sethserver.com)",
21 | "license": "Apache 2.0",
22 | "bugs": {
23 | "url": "https://github.com/sethblack/javascript-strong-password-generator/issues"
24 | },
25 | "homepage": "https://github.com/sethblack/javascript-strong-password-generator#readme",
26 | "devDependencies": {
27 | "babel-cli": "^6.26.0",
28 | "babel-loader": "^7.1.2",
29 | "babel-preset-env": "^1.6.1",
30 | "eslint": "^4.11.0",
31 | "eslint-config-airbnb-base": "^12.1.0",
32 | "eslint-plugin-import": "^2.8.0",
33 | "mocha": "^4.0.1",
34 | "uglifyjs-webpack-plugin": "^1.0.0-rc.0",
35 | "webpack": "^3.8.1"
36 | },
37 | "dependencies": {
38 | "javascript-fortuna": "^1.0.8",
39 | "js-sha512": "^0.6.0",
40 | "systeminformation": "^5.6.4"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/test/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * index.js: Strong Password Generator
3 | *
4 | * (C) 2017 Seth Black
5 | *
6 | */
7 |
8 | const assert = require('assert');
9 | const jsspg = require('../lib/jsspg');
10 |
11 | describe('Strong Password Generator', () => {
12 | it('should init and set isetup up to a sane state', () => {
13 | jsspg.init();
14 |
15 | assert(jsspg.initialized);
16 | });
17 |
18 | it('should work out of the box', () => {
19 | jsspg.init();
20 |
21 | const password = jsspg.generate();
22 |
23 | assert(password.length > 0);
24 | });
25 |
26 | it('should should work with a length param', () => {
27 | jsspg.init();
28 |
29 | const password = jsspg.generate(46);
30 |
31 | assert(password.length >= 46);
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const webpack = require('webpack');
3 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
4 |
5 | module.exports = {
6 | entry: './lib/jsspg.js',
7 | output: {
8 | path: path.resolve(__dirname, 'build'),
9 | filename: 'jsspg.min.js'
10 | },
11 | plugins: [
12 | new UglifyJsPlugin({
13 | extractComments: true,
14 | })
15 | ],
16 | module: {
17 | loaders: [
18 | {
19 | test: /\.js$/,
20 | loader: 'babel-loader',
21 | query: {
22 | presets: ['env']
23 | }
24 | }
25 | ]
26 | },
27 | stats: {
28 | colors: true
29 | },
30 | devtool: 'source-map',
31 | };
--------------------------------------------------------------------------------