<commit_before>mpw-js
======

mpw-js is a JavaScript + Web Crypto implementation of the Master Password App ([Lyndir/MasterPassword](https://github.com/Lyndir/MasterPassword)) algorithm (<http://masterpasswordapp.com/algorithm.html>).

mpw-js relies heavily on `window.crypto.subtle` and will only work on a modern browser. It is written in ES6 JS but is transpiled to ES5 JS for browsers that do not yet support ES6 JS. It is purely intended as a proof-of-concept.

The `MPW` class implements `static calculateKey(name, password)` which is an implementation of step 1 of the algorithm, *Calculate the __master key__ from a user's name and master password*, it accepts two arguments, the users full name and the users master password; `calculateKey` is invoked automatically by the constructor.

`MPW` also implements `calculateSeed(site, counter = 0)`, an implementation of step 2 of the algorithm, *Calculate the __template seed__ from the site's name and counter*, it accepts two arguments, the name of the site -- potentially it's FQDN -- and a counter -- *This is an integer that can be incremented when the user needs a new password for the site*.

`MPW` implements `generate(site, counter = 0, template = "long")` which is an implementation of step 3 of the algorithm, *Encode a __site password__ using the site's type template*, it accepts three arguments, the name of the site -- potentially it's FQDN -- and a counter -- *This is an integer that can be incremented when the user needs a new password for the site.* -- which are passed to `calculateSeed`, and `template` which refers to any of the 'Password Type Templates' supported by the algorithm -- maximum, long, medium, short, basic or pin.<commit_msg>More README.md<commit_after>mpw-js
======

mpw-js is a JavaScript + Web Crypto implementation of the Master Password App ([Lyndir/MasterPassword](https://github.com/Lyndir/MasterPassword)) algorithm (<http://masterpasswordapp.com/algorithm.html>).

mpw-js relies heavily on `window.crypto.subtle` and will only work on a modern browser. It is written in ES6 JS but is transpiled to ES5 JS for browsers that do not yet support ES6 JS. It is purely intended as a proof-of-concept.

The `MPW` class implements `static calculateKey(name, password)` which is an implementation of step 1 of the algorithm, *Calculate the __master key__ from a user's name and master password*, it accepts two arguments, the users full name and the users master password; `calculateKey` is invoked automatically by the constructor.

`MPW` also implements `calculateSeed(site, counter = 0)`, an implementation of step 2 of the algorithm, *Calculate the __template seed__ from the site's name and counter*, it accepts two arguments, the name of the site -- potentially it's FQDN -- and a counter -- *This is an integer that can be incremented when the user needs a new password for the site*; `calculateSeed` is invoked automatically by `generate`.

`MPW` implements `generate(site, counter = 0, template = "long")` which is an implementation of step 3 of the algorithm, *Encode a __site password__ using the site's type template*, it accepts three arguments, the name of the site -- potentially it's FQDN -- and a counter -- *This is an integer that can be incremented when the user needs a new password for the site.* -- which are passed to `calculateSeed`, and `template` which refers to any of the 'Password Type Templates' supported by the algorithm -- maximum, long, medium, short, basic or pin.

`MPW` finally implements `invalidate()` which set `.key` to a `Promise.reject`, preventing further access to the non-exportable key.
{'fraction_non_alphanumeric': 0.07857733664185278, 'fraction_numerical': 0.0044113592500689275, 'mean_word_length': 4.6248062015503875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1100497', 'n_tokens_mistral': 954, 'n_tokens_neox': 904, 'n_words': 519}