From 7c2bcc3f9b57a2b33f86a8b3b143d8da752e6172 Mon Sep 17 00:00:00 2001 From: Quantum Date: Mon, 26 Nov 2018 22:24:31 -0500 Subject: [PATCH] Add password generator proper and small word list --- package-lock.json | 34 +- package.json | 2 + src/app.js | 1 + src/app.scss | 6 +- src/generator.js | 62 ++ src/index.html | 42 +- src/ui.js | 50 ++ src/words/2048.js | 2050 ++++++++++++++++++++++++++++++++++++++++++++ src/words/index.js | 5 + webpack.config.js | 6 +- 10 files changed, 2229 insertions(+), 29 deletions(-) create mode 100644 src/generator.js create mode 100644 src/ui.js create mode 100644 src/words/2048.js create mode 100644 src/words/index.js diff --git a/package-lock.json b/package-lock.json index 6e812a6..b5406d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -523,7 +523,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", @@ -681,6 +682,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1142,7 +1144,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "1.6.2", @@ -1227,6 +1230,11 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -2272,6 +2280,11 @@ "mime-types": "^2.1.12" } }, + "form-serializer": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/form-serializer/-/form-serializer-2.5.0.tgz", + "integrity": "sha1-yuovrLwbzuf2VdkTZwcTPz+staM=" + }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -2318,7 +2331,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "1.2.4", @@ -2929,6 +2943,7 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3444,6 +3459,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -3452,7 +3468,8 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true }, "internal-ip": { "version": "3.0.1", @@ -4178,6 +4195,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4665,6 +4683,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } @@ -4853,7 +4872,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-is-inside": { "version": "1.0.2", @@ -5583,6 +5603,7 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, "requires": { "glob": "^7.0.5" } @@ -7323,7 +7344,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "xregexp": { "version": "4.0.0", diff --git a/package.json b/package.json index ea7b595..88bc4be 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "dependencies": { "bootstrap": "^4.1.3", "clipboard": "^2.0.4", + "core-js": "^2.5.7", + "form-serializer": "^2.5.0", "jquery": "^3.3.1", "octicons": "^8.1.3", "popper.js": "^1.14.5" diff --git a/src/app.js b/src/app.js index a61d1b1..c598426 100644 --- a/src/app.js +++ b/src/app.js @@ -1,3 +1,4 @@ import './app.scss' import './clipboard' import './navbar' +import './ui' diff --git a/src/app.scss b/src/app.scss index 14a26bf..0a05c9c 100644 --- a/src/app.scss +++ b/src/app.scss @@ -31,4 +31,8 @@ body { #password-bits { height: 1.5rem; -} \ No newline at end of file + + .bg-warning { + color: $body-color; + } +} diff --git a/src/generator.js b/src/generator.js new file mode 100644 index 0000000..214c925 --- /dev/null +++ b/src/generator.js @@ -0,0 +1,62 @@ +import words from './words' + +const digits = '0123456789' +const symbols = '`~!@#$%^&*()_+-=,./<>?;:|' + +export function getWordList (name) { + if (['small'].includes(name)) { + return words[name] + } + throw new Error(`Invalid word list: ${name}`) +} + +export function getWords (list, indices) { + return Array.from(indices).map(index => list[index % list.length]) +} + +export function capitalize (string) { + return string[0].toUpperCase() + string.slice(1) +} + +function pickWords (list, number) { + const array = new Uint16Array(number) + window.crypto.getRandomValues(array) + return getWords(list, array) +} + +function pickChar (options) { + const array = new Uint32Array(1) + window.crypto.getRandomValues(array) + return options[array[0] % options.length] +} + +export function generate (options) { + let words = pickWords(getWordList(options.list), options.count) + + if (options.capitalize) { + words = words.map(capitalize) + } + + if (options.symbol) { + words.push(pickChar(symbols)) + } + + if (options.digit) { + words.push(pickChar(digits)) + } + + return words.join('') +} + +export function lengthBits (list) { + return Math.log2(list.length) +} + +export function computeBits (options) { + const wordBits = lengthBits(getWordList(options.list)) + const capsBits = options.capitalize ? 1 : 0 + const symbolBits = options.symbol ? lengthBits(symbols) : 0 + const digitBits = options.digit ? lengthBits(digits) : 0 + + return wordBits * options.count + capsBits + symbolBits + digitBits +} diff --git a/src/index.html b/src/index.html index cbf0ce9..0570926 100644 --- a/src/index.html +++ b/src/index.html @@ -32,31 +32,31 @@

This is a truly secure password generator that generates easy-to-remember passwords.


-
-
- -
- -
+
+ +
+
+
-
-
44 bits -
+
+
44 bits
+
+
- - - + +
@@ -64,7 +64,7 @@
- +
@@ -72,15 +72,15 @@
Options
- +
- +
- +
diff --git a/src/ui.js b/src/ui.js new file mode 100644 index 0000000..0a1022d --- /dev/null +++ b/src/ui.js @@ -0,0 +1,50 @@ +import $ from 'jquery/dist/jquery' +import 'form-serializer/jquery.serialize-object' + +import { generate, computeBits } from './generator' + +$(() => { + const $options = $('#options-form') + const $output = $('#generated-password') + const $bits = $('#password-bits').find('div') + + $('#run-generator').click(() => { + const options = $options.serializeObject() + $output.val(generate(options)) + return false + }) + + const classes = 'bg-danger bg-warning bg-info bg-success' + + function bitClass (bits) { + if (bits < 44) { + return 'bg-danger' + } else if (bits < 64) { + return 'bg-warning' + } else if (bits < 80) { + return 'bg-info' + } else { + return 'bg-success' + } + } + + function bitRound (value) { + const rounded = Math.round(value) + return rounded === value ? value : `≈ ${rounded}` + } + + function updateBitMeter () { + const options = $options.serializeObject() + const bits = computeBits(options) + const maxBits = 96 + $bits + .removeClass(classes) + .addClass(bitClass(bits)) + .text(`${bitRound(bits)} bits`) + .css('width', `${bits / maxBits * 100}%`) + } + + $options.find('select, input').change(updateBitMeter) + $options.find('input[type=nubmer]').on('input', updateBitMeter) + updateBitMeter() +}) diff --git a/src/words/2048.js b/src/words/2048.js new file mode 100644 index 0000000..edade48 --- /dev/null +++ b/src/words/2048.js @@ -0,0 +1,2050 @@ +export default [ + 'ability', + 'able', + 'about', + 'above', + 'abroad', + 'absence', + 'absent', + 'absolute', + 'absurd', + 'accept', + 'access', + 'accompany', + 'accordance', + 'account', + 'acquaintance', + 'across', + 'act', + 'action', + 'active', + 'activity', + 'actual', + 'add', + 'addition', + 'address', + 'administration', + 'admirable', + 'admiration', + 'admit', + 'advance', + 'advantage', + 'adventure', + 'advice', + 'affair', + 'affection', + 'afford', + 'afraid', + 'africa', + 'after', + 'afternoon', + 'again', + 'against', + 'age', + 'agent', + 'ago', + 'agony', + 'agree', + 'agreeable', + 'agreement', + 'ahead', + 'aid', + 'aim', + 'air', + 'alarm', + 'alice', + 'alike', + 'alive', + 'all', + 'allow', + 'almost', + 'alone', + 'along', + 'aloud', + 'already', + 'also', + 'altar', + 'although', + 'altogether', + 'always', + 'ambition', + 'amid', + 'among', + 'amongst', + 'amount', + 'amusement', + 'ancient', + 'angel', + 'anger', + 'angry', + 'animal', + 'announcement', + 'annual', + 'another', + 'answer', + 'anxiety', + 'anxious', + 'any', + 'anybody', + 'anyone', + 'anything', + 'anywhere', + 'apart', + 'apartment', + 'apparent', + 'appeal', + 'appear', + 'appearance', + 'applicable', + 'application', + 'approach', + 'apt', + 'are', + 'argument', + 'arise', + 'arm', + 'army', + 'arose', + 'around', + 'arrangement', + 'arrival', + 'arrive', + 'art', + 'article', + 'artist', + 'aside', + 'ask', + 'asleep', + 'aspect', + 'assist', + 'assistance', + 'assume', + 'assure', + 'astonishment', + 'ate', + 'atmosphere', + 'attack', + 'attempt', + 'attend', + 'attention', + 'attitude', + 'audience', + 'august', + 'aunt', + 'author', + 'authority', + 'autumn', + 'available', + 'average', + 'avoid', + 'awake', + 'aware', + 'away', + 'awful', + 'baby', + 'back', + 'bad', + 'bade', + 'bag', + 'balance', + 'ball', + 'bank', + 'bar', + 'bare', + 'base', + 'basis', + 'battle', + 'bay', + 'bear', + 'bearing', + 'beast', + 'beat', + 'beautiful', + 'beauty', + 'because', + 'become', + 'bed', + 'before', + 'beg', + 'begin', + 'behalf', + 'behind', + 'behold', + 'bell', + 'belong', + 'below', + 'beneath', + 'benefit', + 'bent', + 'beside', + 'best', + 'better', + 'between', + 'beyond', + 'bid', + 'big', + 'bill', + 'bird', + 'birth', + 'bit', + 'bitter', + 'black', + 'blame', + 'bless', + 'blind', + 'blockquote', + 'blood', + 'blow', + 'blue', + 'boat', + 'body', + 'bold', + 'book', + 'bore', + 'born', + 'bosom', + 'both', + 'bottle', + 'bottom', + 'bought', + 'bound', + 'bow', + 'box', + 'boy', + 'brain', + 'branch', + 'brave', + 'bread', + 'break', + 'breakfast', + 'breast', + 'breath', + 'breeze', + 'brethren', + 'bride', + 'bridge', + 'brief', + 'bright', + 'brilliant', + 'bring', + 'brother', + 'brought', + 'brown', + 'build', + 'building', + 'burden', + 'burn', + 'burst', + 'business', + 'busy', + 'but', + 'butter', + 'buy', + 'cabin', + 'call', + 'calm', + 'camp', + 'campaign', + 'can', + 'cannot', + 'cap', + 'capable', + 'capacity', + 'capital', + 'captain', + 'car', + 'cardinal', + 'care', + 'career', + 'careful', + 'carriage', + 'carry', + 'case', + 'cast', + 'castle', + 'cat', + 'catch', + 'cattle', + 'caught', + 'cause', + 'cavalry', + 'cave', + 'cease', + 'cent', + 'central', + 'centre', + 'century', + 'ceremony', + 'certain', + 'chain', + 'chair', + 'chamber', + 'chance', + 'change', + 'chapter', + 'character', + 'characteristic', + 'charge', + 'charity', + 'charm', + 'check', + 'cheerful', + 'chest', + 'chief', + 'child', + 'childhood', + 'choice', + 'choose', + 'chose', + 'church', + 'circle', + 'circumstance', + 'city', + 'civil', + 'civilization', + 'claim', + 'class', + 'clean', + 'clear', + 'clerk', + 'clever', + 'clock', + 'close', + 'closer', + 'cloth', + 'cloud', + 'club', + 'coach', + 'coast', + 'coat', + 'coffee', + 'cold', + 'collection', + 'college', + 'colour', + 'come', + 'comfort', + 'comfortable', + 'command', + 'commander', + 'commerce', + 'commercial', + 'commission', + 'common', + 'communication', + 'community', + 'companion', + 'company', + 'comparison', + 'complete', + 'compliance', + 'composition', + 'computer', + 'conceal', + 'conception', + 'concern', + 'conclusion', + 'condition', + 'conduct', + 'confess', + 'confidence', + 'conflict', + 'confusion', + 'connection', + 'conscience', + 'conscious', + 'consent', + 'consequence', + 'consider', + 'considerable', + 'consideration', + 'constant', + 'constitution', + 'construction', + 'contact', + 'contain', + 'contempt', + 'content', + 'continue', + 'contrast', + 'control', + 'conversation', + 'convey', + 'conviction', + 'cook', + 'cool', + 'copy', + 'copyright', + 'corn', + 'corner', + 'correct', + 'corrupt', + 'cost', + 'cottage', + 'cotton', + 'could', + 'council', + 'counsel', + 'count', + 'country', + 'county', + 'couple', + 'courage', + 'course', + 'court', + 'cousin', + 'cover', + 'create', + 'creation', + 'creature', + 'credit', + 'crew', + 'crime', + 'criminal', + 'critical', + 'criticism', + 'cross', + 'crown', + 'cruel', + 'cup', + 'cure', + 'curiosity', + 'curious', + 'current', + 'curse', + 'custom', + 'cut', + 'daily', + 'damage', + 'dance', + 'danger', + 'dangerous', + 'dare', + 'dark', + 'date', + 'daughter', + 'dawn', + 'day', + 'day', + 'dead', + 'deal', + 'dear', + 'death', + 'debt', + 'decide', + 'decision', + 'deck', + 'declare', + 'deep', + 'deeper', + 'defeat', + 'defective', + 'defend', + 'definite', + 'degree', + 'delay', + 'delicate', + 'delight', + 'deliver', + 'demand', + 'deny', + 'departure', + 'depend', + 'depth', + 'derive', + 'describe', + 'description', + 'desert', + 'design', + 'desire', + 'desk', + 'despair', + 'desperate', + 'destroy', + 'destruction', + 'detail', + 'determination', + 'determine', + 'development', + 'devil', + 'devotion', + 'did', + 'die', + 'difference', + 'different', + 'difficult', + 'dignity', + 'dim', + 'dinner', + 'direct', + 'direction', + 'dirty', + 'discipline', + 'discourse', + 'discover', + 'discovery', + 'discussion', + 'disease', + 'disgrace', + 'disk', + 'display', + 'disposition', + 'distance', + 'distant', + 'distinct', + 'distinction', + 'distress', + 'distribute', + 'distribution', + 'district', + 'divine', + 'division', + 'doctor', + 'doctrine', + 'dog', + 'domain', + 'domestic', + 'don', + 'donate', + 'done', + 'door', + 'doth', + 'double', + 'doubt', + 'doubtful', + 'doubtless', + 'down', + 'dozen', + 'drank', + 'draw', + 'drawn', + 'dread', + 'dreadful', + 'dream', + 'dress', + 'drew', + 'drink', + 'drive', + 'drop', + 'drove', + 'drunk', + 'due', + 'duke', + 'dull', + 'during', + 'dust', + 'duty', + 'dwell', + 'each', + 'eager', + 'ear', + 'earlier', + 'earnest', + 'earth', + 'ease', + 'easily', + 'east', + 'eat', + 'edge', + 'edition', + 'education', + 'effect', + 'effort', + 'eight', + 'eighteen', + 'either', + 'elder', + 'election', + 'electronic', + 'element', + 'eleven', + 'else', + 'elsewhere', + 'email', + 'emotion', + 'emperor', + 'empire', + 'employment', + 'empty', + 'enable', + 'end', + 'endure', + 'enemy', + 'energy', + 'engagement', + 'english', + 'enjoy', + 'enjoyment', + 'enormous', + 'enough', + 'enter', + 'enterprise', + 'enthusiasm', + 'entire', + 'entrance', + 'equal', + 'equipment', + 'equivalent', + 'error', + 'escape', + 'essential', + 'establishment', + 'estate', + 'estimate', + 'eternal', + 'even', + 'evening', + 'event', + 'ever', + 'every', + 'everybody', + 'everything', + 'everywhere', + 'evidence', + 'evident', + 'evil', + 'exact', + 'examination', + 'examine', + 'example', + 'excellent', + 'except', + 'exception', + 'exchange', + 'excitement', + 'excuse', + 'execution', + 'exercise', + 'exist', + 'existence', + 'expect', + 'expedition', + 'expense', + 'experience', + 'explain', + 'explanation', + 'express', + 'expression', + 'exquisite', + 'extent', + 'external', + 'extraordinary', + 'extreme', + 'eye', + 'face', + 'fact', + 'fail', + 'failure', + 'faint', + 'fair', + 'faith', + 'fall', + 'false', + 'fame', + 'familiar', + 'family', + 'famous', + 'fancy', + 'far', + 'farewell', + 'farm', + 'farmer', + 'farther', + 'fashion', + 'fast', + 'fat', + 'fate', + 'father', + 'fault', + 'favour', + 'favourite', + 'fear', + 'fearful', + 'feast', + 'february', + 'fee', + 'feeble', + 'feel', + 'feet', + 'fell', + 'fellow', + 'felt', + 'female', + 'fever', + 'few', + 'field', + 'fierce', + 'fifteen', + 'fifty', + 'fight', + 'figure', + 'file', + 'fill', + 'fine', + 'finger', + 'finish', + 'fire', + 'firm', + 'first', + 'fish', + 'fit', + 'five', + 'fix', + 'flag', + 'flame', + 'flash', + 'flat', + 'fleet', + 'flesh', + 'flew', + 'flight', + 'flood', + 'floor', + 'flow', + 'flower', + 'flung', + 'foe', + 'folk', + 'follow', + 'folly', + 'fond', + 'food', + 'fool', + 'foolish', + 'foot', + 'for', + 'force', + 'forehead', + 'foreign', + 'forest', + 'forever', + 'forget', + 'forgive', + 'form', + 'format', + 'former', + 'fort', + 'forth', + 'fortunate', + 'fortune', + 'forty', + 'forward', + 'fought', + 'found', + 'foundation', + 'four', + 'fourth', + 'frame', + 'frank', + 'free', + 'freedom', + 'french', + 'frequent', + 'fresh', + 'friend', + 'from', + 'front', + 'fruit', + 'full', + 'fun', + 'furniture', + 'further', + 'fury', + 'future', + 'gain', + 'gallant', + 'game', + 'garden', + 'gate', + 'gather', + 'gave', + 'gaze', + 'general', + 'generation', + 'generous', + 'genius', + 'gentle', + 'gentleman', + 'genuine', + 'george', + 'gesture', + 'get', + 'giant', + 'gift', + 'girl', + 'girl', + 'give', + 'glad', + 'glance', + 'glass', + 'gloom', + 'glorious', + 'glory', + 'god', + 'goes', + 'gold', + 'gone', + 'good', + 'got', + 'government', + 'governor', + 'grace', + 'gracious', + 'grain', + 'grant', + 'grasp', + 'grass', + 'grateful', + 'gratitude', + 'grave', + 'gray', + 'great', + 'greek', + 'green', + 'grew', + 'grey', + 'grief', + 'gross', + 'ground', + 'group', + 'grow', + 'grown', + 'growth', + 'guard', + 'guess', + 'guest', + 'guide', + 'guilty', + 'gun', + 'habit', + 'had', + 'hair', + 'half', + 'hall', + 'handle', + 'handsome', + 'hang', + 'happen', + 'happy', + 'hard', + 'harm', + 'harmless', + 'harmony', + 'hart', + 'has', + 'hast', + 'haste', + 'hastily', + 'hat', + 'hate', + 'have', + 'head', + 'health', + 'hear', + 'heart', + 'heat', + 'heaven', + 'heavy', + 'height', + 'help', + 'helpless', + 'hence', + 'her', + 'here', + 'hero', + 'herself', + 'hide', + 'high', + 'hill', + 'him', + 'himself', + 'his', + 'history', + 'hit', + 'hitherto', + 'hold', + 'holder', + 'hole', + 'hollow', + 'holy', + 'home', + 'honest', + 'honour', + 'hope', + 'horizon', + 'horrible', + 'horror', + 'horse', + 'hospital', + 'host', + 'hot', + 'hotel', + 'hour', + 'house', + 'household', + 'how', + 'however', + 'huge', + 'human', + 'humanity', + 'humble', + 'humour', + 'hundred', + 'hung', + 'hunger', + 'hungry', + 'hunt', + 'hurry', + 'hurt', + 'husband', + 'ice', + 'idea', + 'ideal', + 'idle', + 'ignorance', + 'ignorant', + 'ill', + 'image', + 'imagination', + 'imagine', + 'immediate', + 'immense', + 'importance', + 'important', + 'impossible', + 'impression', + 'impulse', + 'inch', + 'incident', + 'include', + 'increase', + 'indeed', + 'independence', + 'independent', + 'indicate', + 'indifference', + 'indifferent', + 'indignation', + 'individual', + 'industry', + 'inferior', + 'infinite', + 'influence', + 'information', + 'injury', + 'inn', + 'inner', + 'innocent', + 'inquiry', + 'inside', + 'instance', + 'instant', + 'instead', + 'instinct', + 'instruction', + 'instrument', + 'intellect', + 'intellectual', + 'intelligence', + 'intelligent', + 'intense', + 'intention', + 'interest', + 'interior', + 'interview', + 'intimate', + 'into', + 'introduction', + 'invitation', + 'iron', + 'island', + 'issue', + 'its', + 'itself', + 'jack', + 'jane', + 'jealous', + 'job', + 'join', + 'joy', + 'judge', + 'judgment', + 'july', + 'june', + 'just', + 'justice', + 'keen', + 'keep', + 'key', + 'kill', + 'kindness', + 'king', + 'kingdom', + 'kiss', + 'kitchen', + 'knee', + 'knife', + 'knight', + 'know', + 'knowledge', + 'labour', + 'lack', + 'lad', + 'lady', + 'lake', + 'lamp', + 'land', + 'lane', + 'language', + 'large', + 'larger', + 'last', + 'late', + 'later', + 'latter', + 'laugh', + 'laughter', + 'law', + 'lawyer', + 'lay', + 'leader', + 'learn', + 'least', + 'leave', + 'left', + 'leg', + 'length', + 'lesson', + 'lest', + 'let', + 'letter', + 'level', + 'liability', + 'liberal', + 'liberty', + 'library', + 'license', + 'lie', + 'life', + 'lift', + 'light', + 'like', + 'likewise', + 'limitation', + 'line', + 'list', + 'listen', + 'literary', + 'literature', + 'little', + 'live', + 'local', + 'lofty', + 'long', + 'longer', + 'look', + 'loose', + 'lord', + 'lose', + 'loss', + 'lot', + 'loud', + 'louis', + 'love', + 'lover', + 'low', + 'lower', + 'luck', + 'machine', + 'mad', + 'made', + 'magic', + 'magnificent', + 'maiden', + 'main', + 'maintain', + 'majority', + 'make', + 'male', + 'man', + 'manage', + 'mankind', + 'manner', + 'many', + 'marble', + 'march', + 'mark', + 'market', + 'marriage', + 'marry', + 'master', + 'match', + 'material', + 'matter', + 'may', + 'meal', + 'mean', + 'meaning', + 'measure', + 'meat', + 'medium', + 'meet', + 'melancholy', + 'member', + 'memory', + 'mental', + 'mention', + 'merchant', + 'mercy', + 'mere', + 'merit', + 'merry', + 'message', + 'messenger', + 'met', + 'method', + 'michael', + 'middle', + 'midnight', + 'midst', + 'might', + 'mile', + 'military', + 'milk', + 'million', + 'mind', + 'mine', + 'minister', + 'minute', + 'mischief', + 'miserable', + 'misery', + 'misfortune', + 'mission', + 'mistake', + 'mistress', + 'mode', + 'modern', + 'moment', + 'money', + 'month', + 'mood', + 'moon', + 'moral', + 'more', + 'moreover', + 'morning', + 'most', + 'mother', + 'mother', + 'motion', + 'motive', + 'mountain', + 'mouth', + 'move', + 'movement', + 'much', + 'mud', + 'multitude', + 'murder', + 'music', + 'must', + 'mutual', + 'myself', + 'mysterious', + 'mystery', + 'name', + 'narrative', + 'narrow', + 'nation', + 'native', + 'natural', + 'nature', + 'near', + 'necessary', + 'necessity', + 'neck', + 'neither', + 'nervous', + 'never', + 'nevertheless', + 'new', + 'newspaper', + 'next', + 'nice', + 'night', + 'nine', + 'noble', + 'nobody', + 'noise', + 'non', + 'none', + 'noon', + 'nor', + 'north', + 'nose', + 'not', + 'note', + 'nothing', + 'notice', + 'notion', + 'novel', + 'now', + 'number', + 'numerous', + 'nurse', + 'oath', + 'obedience', + 'obey', + 'object', + 'obs', + 'observation', + 'observe', + 'obtain', + 'obvious', + 'occasion', + 'occupation', + 'occur', + 'ocean', + 'odd', + 'off', + 'offer', + 'office', + 'officer', + 'official', + 'often', + 'oil', + 'old', + 'older', + 'once', + 'one', + 'online', + 'only', + 'open', + 'operation', + 'opinion', + 'opportunity', + 'opposite', + 'opposition', + 'order', + 'ordinary', + 'organization', + 'origin', + 'other', + 'otherwise', + 'ought', + 'our', + 'out', + 'outer', + 'outside', + 'outward', + 'over', + 'overcome', + 'owe', + 'own', + 'owner', + 'pace', + 'page', + 'pain', + 'pair', + 'palace', + 'pale', + 'paper', + 'paradise', + 'paragraph', + 'pardon', + 'part', + 'particular', + 'party', + 'pass', + 'passage', + 'passion', + 'past', + 'path', + 'patience', + 'patient', + 'paul', + 'pause', + 'pay', + 'payment', + 'peace', + 'peculiar', + 'pen', + 'people', + 'per', + 'perceive', + 'perfect', + 'perfection', + 'perform', + 'performance', + 'perhaps', + 'period', + 'permanent', + 'permission', + 'permit', + 'person', + 'peter', + 'philosophy', + 'phrase', + 'physical', + 'physician', + 'pick', + 'picture', + 'piece', + 'pipe', + 'pity', + 'place', + 'plain', + 'plan', + 'plant', + 'plate', + 'platform', + 'play', + 'pleasant', + 'please', + 'pleasure', + 'plenty', + 'pocket', + 'poem', + 'poet', + 'poetry', + 'point', + 'police', + 'policy', + 'poor', + 'pope', + 'popular', + 'population', + 'port', + 'portion', + 'portrait', + 'position', + 'positive', + 'possess', + 'possession', + 'possibility', + 'possible', + 'post', + 'pour', + 'poverty', + 'power', + 'powerful', + 'practical', + 'practice', + 'praise', + 'pray', + 'prayer', + 'precious', + 'prefer', + 'prepare', + 'presence', + 'present', + 'preserve', + 'pressure', + 'pretty', + 'prevent', + 'previous', + 'prey', + 'price', + 'pride', + 'priest', + 'prince', + 'print', + 'prison', + 'prisoner', + 'private', + 'privilege', + 'prize', + 'probable', + 'probably', + 'process', + 'produce', + 'production', + 'profession', + 'profit', + 'profound', + 'progress', + 'promise', + 'proof', + 'proper', + 'property', + 'prophet', + 'proprietary', + 'prospect', + 'prosperity', + 'protect', + 'protection', + 'proud', + 'prove', + 'provide', + 'providence', + 'province', + 'provision', + 'public', + 'pull', + 'punishment', + 'purchase', + 'pure', + 'purple', + 'purpose', + 'pursuit', + 'put', + 'quality', + 'quantity', + 'quarrel', + 'quarter', + 'queen', + 'queer', + 'question', + 'quick', + 'quiet', + 'quite', + 'race', + 'rage', + 'rain', + 'raise', + 'range', + 'rank', + 'rapid', + 'rare', + 'rate', + 'rather', + 'reach', + 'read', + 'readable', + 'reader', + 'readily', + 'ready', + 'real', + 'reality', + 'realize', + 'rear', + 'reason', + 'reasonable', + 'recall', + 'receipt', + 'receive', + 'recent', + 'reckon', + 'recognize', + 'record', + 'red', + 'reference', + 'reflection', + 'refuge', + 'refund', + 'refuse', + 'regard', + 'regiment', + 'region', + 'regret', + 'regular', + 'reign', + 'relation', + 'relative', + 'release', + 'relief', + 'religion', + 'religious', + 'remain', + 'remark', + 'remarkable', + 'remember', + 'remote', + 'remove', + 'render', + 'rent', + 'repeat', + 'replacement', + 'reply', + 'report', + 'represent', + 'reputation', + 'request', + 'require', + 'residence', + 'resist', + 'resistance', + 'resolution', + 'respect', + 'respectable', + 'responsibility', + 'responsible', + 'rest', + 'result', + 'return', + 'revenge', + 'revolution', + 'reward', + 'rich', + 'richard', + 'rid', + 'ride', + 'ridiculous', + 'right', + 'ring', + 'rise', + 'risk', + 'rival', + 'river', + 'road', + 'robert', + 'rock', + 'rode', + 'roll', + 'roman', + 'romance', + 'roof', + 'room', + 'root', + 'rope', + 'rose', + 'rough', + 'round', + 'route', + 'row', + 'royal', + 'royalty', + 'rude', + 'ruin', + 'rule', + 'run', + 'rush', + 'sacred', + 'sacrifice', + 'sad', + 'saddle', + 'safe', + 'safety', + 'said', + 'sail', + 'sake', + 'sale', + 'salt', + 'sam', + 'same', + 'sang', + 'sank', + 'satisfaction', + 'satisfactory', + 'satisfy', + 'savage', + 'save', + 'saw', + 'say', + 'scale', + 'scarce', + 'scene', + 'scheme', + 'school', + 'science', + 'scientific', + 'score', + 'scorn', + 'scotland', + 'sea', + 'search', + 'season', + 'seat', + 'second', + 'secret', + 'section', + 'secure', + 'security', + 'see', + 'seek', + 'seem', + 'seldom', + 'self', + 'sell', + 'sensation', + 'sense', + 'sensible', + 'sentence', + 'sentiment', + 'separate', + 'serious', + 'servant', + 'serve', + 'service', + 'set', + 'settle', + 'settlement', + 'seven', + 'severe', + 'shade', + 'shadow', + 'shake', + 'shall', + 'shame', + 'shape', + 'share', + 'sharp', + 'she', + 'sheep', + 'sheet', + 'shelter', + 'ship', + 'shock', + 'shone', + 'shook', + 'shoot', + 'shop', + 'shore', + 'short', + 'shot', + 'should', + 'shoulder', + 'show', + 'shown', + 'shut', + 'sick', + 'side', + 'sigh', + 'sight', + 'sign', + 'silence', + 'silent', + 'silk', + 'silly', + 'silver', + 'similar', + 'simple', + 'simplicity', + 'sin', + 'since', + 'sincere', + 'sing', + 'single', + 'singular', + 'sister', + 'sit', + 'site', + 'situation', + 'six', + 'sixty', + 'size', + 'skill', + 'skin', + 'slave', + 'slavery', + 'sleep', + 'slender', + 'slight', + 'slip', + 'slow', + 'small', + 'smaller', + 'smell', + 'smile', + 'smith', + 'smoke', + 'smooth', + 'snow', + 'social', + 'society', + 'soft', + 'software', + 'soil', + 'soldier', + 'sole', + 'solemn', + 'solid', + 'solitary', + 'some', + 'somebody', + 'somehow', + 'someone', + 'something', + 'somewhat', + 'somewhere', + 'son', + 'song', + 'soon', + 'sooner', + 'sore', + 'sorrow', + 'sorry', + 'sort', + 'sought', + 'soul', + 'sound', + 'source', + 'south', + 'southern', + 'sovereign', + 'space', + 'spain', + 'spanish', + 'spare', + 'speak', + 'special', + 'species', + 'specific', + 'speech', + 'speed', + 'spend', + 'spent', + 'spirit', + 'spiritual', + 'spite', + 'splendid', + 'spoke', + 'spot', + 'spread', + 'spring', + 'square', + 'staff', + 'stage', + 'stand', + 'standard', + 'star', + 'start', + 'state', + 'statement', + 'station', + 'status', + 'stay', + 'steady', + 'steel', + 'steep', + 'step', + 'stern', + 'stick', + 'stiff', + 'still', + 'stir', + 'stock', + 'stone', + 'stood', + 'stop', + 'store', + 'storm', + 'story', + 'stout', + 'straight', + 'strain', + 'strange', + 'stranger', + 'stream', + 'street', + 'strength', + 'strike', + 'stroke', + 'strong', + 'stronger', + 'struck', + 'structure', + 'student', + 'study', + 'stuff', + 'stupid', + 'style', + 'subject', + 'submit', + 'substance', + 'succeed', + 'success', + 'successful', + 'succession', + 'such', + 'sudden', + 'suffer', + 'sufficient', + 'sugar', + 'suggest', + 'suggestion', + 'suit', + 'suitable', + 'sum', + 'summer', + 'sun', + 'sunshine', + 'superior', + 'supper', + 'supply', + 'support', + 'suppose', + 'supreme', + 'sure', + 'surface', + 'surprise', + 'suspect', + 'suspicion', + 'swear', + 'sweet', + 'swift', + 'sword', + 'sympathy', + 'system', + 'table', + 'tail', + 'take', + 'tale', + 'talk', + 'tall', + 'task', + 'taste', + 'taught', + 'tax', + 'tea', + 'teach', + 'teacher', + 'tear', + 'teeth', + 'tell', + 'temper', + 'temple', + 'ten', + 'tendency', + 'tender', + 'tent', + 'term', + 'terrible', + 'territory', + 'terror', + 'test', + 'testimony', + 'text', + 'than', + 'thank', + 'theatre', + 'their', + 'them', + 'then', + 'theory', + 'there', + 'thereby', + 'therefore', + 'therein', + 'thereof', + 'these', + 'they', + 'they', + 'thick', + 'thin', + 'thing', + 'think', + 'third', + 'thirty', + 'this', + 'thomas', + 'those', + 'though', + 'thought', + 'thousand', + 'three', + 'throat', + 'throne', + 'through', + 'throughout', + 'throw', + 'thrust', + 'thunder', + 'thus', + 'tide', + 'till', + 'time', + 'tiny', + 'title', + 'together', + 'told', + 'tone', + 'tongue', + 'too', + 'took', + 'top', + 'torn', + 'touch', + 'toward', + 'tower', + 'town', + 'trace', + 'track', + 'trade', + 'trademark', + 'tradition', + 'tragedy', + 'trail', + 'train', + 'travel', + 'treasure', + 'treat', + 'treatment', + 'treaty', + 'tree', + 'trial', + 'tribe', + 'trip', + 'triumph', + 'trouble', + 'true', + 'truly', + 'trust', + 'truth', + 'turn', + 'twelve', + 'twenty', + 'twice', + 'two', + 'type', + 'ugly', + 'unable', + 'uncertain', + 'uncle', + 'unconscious', + 'under', + 'understand', + 'unfortunate', + 'unhappy', + 'uniform', + 'union', + 'universal', + 'universe', + 'unknown', + 'unless', + 'until', + 'unto', + 'unusual', + 'upon', + 'upper', + 'use', + 'useful', + 'useless', + 'usual', + 'utmost', + 'utter', + 'vague', + 'vain', + 'valley', + 'valuable', + 'value', + 'vanity', + 'variety', + 'various', + 'vast', + 'veil', + 'vengeance', + 'venture', + 'verse', + 'version', + 'very', + 'vessel', + 'victim', + 'victory', + 'view', + 'village', + 'violence', + 'violent', + 'virgin', + 'virtue', + 'visible', + 'vision', + 'visit', + 'visitor', + 'voice', + 'volume', + 'vote', + 'voyage', + 'wait', + 'walk', + 'wall', + 'want', + 'war', + 'warm', + 'warning', + 'waste', + 'watch', + 'water', + 'wave', + 'way', + 'weak', + 'wealth', + 'wear', + 'weary', + 'weather', + 'web', + 'wedding', + 'week', + 'weight', + 'welcome', + 'well', + 'went', + 'were', + 'west', + 'western', + 'wet', + 'what', + 'what', + 'whatever', + 'whatsoever', + 'wheel', + 'when', + 'whenever', + 'where', + 'wherever', + 'whether', + 'which', + 'while', + 'whisper', + 'white', + 'who', + 'whole', + 'wholly', + 'whom', + 'whose', + 'widow', + 'wife', + 'wild', + 'wilderness', + 'will', + 'wilt', + 'win', + 'window', + 'wine', + 'winter', + 'wire', + 'wisdom', + 'wise', + 'wish', + 'wit', + 'with', + 'within', + 'without', + 'witness', + 'woman', + 'won', + 'wonder', + 'wooden', + 'word', + 'wordforms', + 'work', + 'world', + 'worn', + 'worse', + 'worship', + 'worst', + 'worth', + 'worthy', + 'would', + 'wound', + 'wrath', + 'write', + 'writer', + 'wrong', + 'wrought', + 'yard', + 'year', + 'yellow', + 'yes', + 'yesterday', + 'yet', + 'yield', + 'you', + 'young', + 'younger', + 'your', + 'yourself', + 'youth', + 'zeal', +] diff --git a/src/words/index.js b/src/words/index.js new file mode 100644 index 0000000..50e442e --- /dev/null +++ b/src/words/index.js @@ -0,0 +1,5 @@ +import small from './2048' + +console.assert(small.length === 2048) + +export default { small } diff --git a/webpack.config.js b/webpack.config.js index d2b491e..a2247f9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,7 +2,11 @@ const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') module.exports = { - entry: './src/app.js', + entry: [ + 'core-js/fn/array/from', + 'core-js/fn/array/includes', + './src/app.js' + ], mode: process.env.NODE_ENV || 'development', output: { filename: '[name].[contenthash].js',