Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
18 lines
516 B
JavaScript
18 lines
516 B
JavaScript
const { zxcvbn, zxcvbnOptions } = require('@zxcvbn-ts/core');
|
|
const { dictionary: commonDictionary, adjacencyGraphs } = require('@zxcvbn-ts/language-common');
|
|
const { dictionary: enDictionary, translations } = require('@zxcvbn-ts/language-en');
|
|
|
|
zxcvbnOptions.setOptions({
|
|
dictionary: {
|
|
...commonDictionary,
|
|
...enDictionary,
|
|
},
|
|
graphs: adjacencyGraphs,
|
|
translations,
|
|
});
|
|
|
|
// Called from Go via goja
|
|
globalThis.zxcvbnScore = function (password) {
|
|
return zxcvbn(password).score;
|
|
};
|