- add password strength meter for creating or editing user passwords
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m0s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m0s
- add public opensearch api host
This commit is contained in:
parent
f4854d70b9
commit
010bead723
13 changed files with 392 additions and 23 deletions
30
resources/js/Components/SimplePasswordMeter/logic/Trie.ts
Normal file
30
resources/js/Components/SimplePasswordMeter/logic/Trie.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import TrieNode from './TieNode';
|
||||
|
||||
export default class Trie {
|
||||
private root: TrieNode;
|
||||
constructor() {
|
||||
this.root = new TrieNode();
|
||||
}
|
||||
|
||||
insert(word: string) {
|
||||
let node: TrieNode = this.root;
|
||||
for (let char of word) {
|
||||
if (!node.children[char]) {
|
||||
node.children[char] = new TrieNode();
|
||||
}
|
||||
node = node.children[char];
|
||||
}
|
||||
node.isEndOfWord = true;
|
||||
}
|
||||
|
||||
search(word: string) {
|
||||
let node = this.root;
|
||||
for (let char of word) {
|
||||
if (!node.children[char]) {
|
||||
return false;
|
||||
}
|
||||
node = node.children[char];
|
||||
}
|
||||
return node.isEndOfWord;
|
||||
}
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue