ethers.js/src.ts/wordlists/wordlist-owla.ts

31 lines
882 B
TypeScript
Raw Normal View History

2022-09-05 23:14:43 +03:00
import { WordlistOwl } from "./wordlist-owl.js";
import { decodeOwlA } from "./decode-owla.js";
2022-11-28 05:45:42 +03:00
/**
* An OWL-A format Wordlist extends the OWL format to add an
* overlay onto an OWL format Wordlist to support diacritic
* marks.
*
* This class is generally not useful to most developers as
* it is used mainly internally to keep Wordlists for languages
* based on latin-1 small.
*
* If necessary, there are tools within the ``generation/`` folder
* to create these necessary data.
*/
2022-09-05 23:14:43 +03:00
export class WordlistOwlA extends WordlistOwl {
#accent: string;
constructor(locale: string, data: string, accent: string, checksum: string) {
super(locale, data, checksum);
this.#accent = accent;
}
get _accent(): string { return this.#accent; }
_decodeWords(): Array<string> {
return decodeOwlA(this._data, this._accent);
}
}