diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index d80f6e59..1ead1569 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -9,7 +9,7 @@ body: id: version attributes: label: corebc version - placeholder: 1.0.0 or commit hash + placeholder: 1.1.0 or commit hash validations: required: true - type: input diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..c3a36b43 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,6 @@ +{ + "MD010": { + "code_blocks": false + }, + "MD013": true +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 90068e17..8fbd8826 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.1.0 + +- Add the German community mnemonic wordlist from dys2p/wordlists-de as `wordlists.de` and `LangDe` in the extra browser bundle. +- Add the Slovak mnemonic wordlist as `wordlists.sk` and `LangSk` in the extra browser wordlist bundle, preserving upstream word order. + ## 1.0.0 - Support the updated Noble hashes, TypeScript 7, Node types, and Rollup dependencies. diff --git a/README.md b/README.md index 5d47fc5c..732f9e42 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ # CoreBC -TypeScript and JavaScript tools for Core Blockchain: Ed448 wallets, signing, Core addresses, `xcb_*` JSON-RPC providers, ABI encoding, smart contracts, and token metadata. +TypeScript and JavaScript tools for Core Blockchain: Ed448 wallets, signing, +Core addresses, `xcb_*` JSON-RPC providers, ABI encoding, smart contracts, and +token metadata. ## Install -Requires Node.js **22.12 or newer**, or a modern browser with BigInt and Web Crypto support. +Requires Node.js **22.12 or newer**, or a modern browser with BigInt and Web +Crypto support. ```sh npm install corebc @@ -19,7 +22,10 @@ console.log(await provider.getBlockNumber()); provider.destroy(); ``` -Use your own Core RPC endpoint. CommonJS is supported with `const { Wallet } = require("corebc")`. The package includes declarations and subpath exports such as `corebc/abi`, `corebc/crypto`, `corebc/providers`, `corebc/cip`, and `corebc/ipfs`. +Use your own Core RPC endpoint. CommonJS is supported with +`const { Wallet } = require("corebc")`. The package includes declarations and +subpath exports such as `corebc/abi`, `corebc/crypto`, `corebc/providers`, +`corebc/cip`, and `corebc/ipfs`. ## Wallets and contracts @@ -31,21 +37,35 @@ console.log(wallet.address); const signature = await wallet.signMessage("Hello Core"); ``` -Wallets support mnemonics, seed derivation, and encrypted JSON keystores. Wallet KDF limits match Core Web3Dart: PBKDF2 permits up to 10 million iterations; scrypt permits `N <= 1048576`, `r * p <= 1048576`, and at most 256 MiB of estimated memory. Wallets exceeding these limits are rejected. Private keys stay with the caller. Core uses 57-byte Ed448 private and public keys and network-prefixed addresses; Ethereum secp256k1 keys are not interchangeable. Keep private keys and recovery phrases out of logs and source control. +Wallets support mnemonics, seed derivation, and encrypted JSON keystores. Wallet +KDF limits match Core Web3Dart: PBKDF2 permits up to 10 million iterations; +scrypt permits `N <= 1048576`, `r * p <= 1048576`, and at most 256 MiB of +estimated memory. Wallets exceeding these limits are rejected. Private keys stay +with the caller. Core uses 57-byte Ed448 private and public keys and +network-prefixed addresses; Ethereum secp256k1 keys are not interchangeable. +Keep private keys and recovery phrases out of logs and source control. -`Contract` accepts JSON or human-readable ABIs and a provider for reads or signer for writes. Transaction fields use `energyLimit`, `energyPrice`, and `networkId`. +`Contract` accepts JSON or human-readable ABIs and a provider for reads or +signer for writes. Transaction fields use `energyLimit`, `energyPrice`, and +`networkId`. -For compatibility, the existing `sha256` and `sha512` exports compute **SHA3-256 and SHA3-512** respectively. `keccak256` is a separate algorithm. Do not substitute hashes when porting signing code. +For compatibility, the existing `sha256` and `sha512` exports compute **SHA3-256 +and SHA3-512** respectively. `keccak256` is a separate algorithm. Do not +substitute hashes when porting signing code. ## CIP metadata The typed helpers follow the same feature scope as Core Web3Dart: -| Standard | Support | -| ---------------------------------------------------------- | -------------------------------------------------------------------------------- | -| [CIP-150](https://cip.coreblockchain.net/cip/cbc/cip-150/) | Read, enumerate, set, and seal on-chain metadata | -| [CIP-151](https://cip.coreblockchain.net/cip/cbc/cip-151/) | Optional expiration and trading-stop timestamps; inclusive boundary checks | -| [CIP-152](https://cip.coreblockchain.net/cip/cbc/cip-152/) | Resolve `lab` references ending in `lab.json` and validate measurement structure | +- [CIP-150]: Read, enumerate, set, and seal on-chain metadata. +- [CIP-151]: Optional expiration and trading-stop timestamps; inclusive boundary + checks. +- [CIP-152]: Resolve `lab` references ending in `lab.json` and validate + measurement structure. + +[CIP-150]: https://cip.coreblockchain.net/cip/cbc/cip-150/ +[CIP-151]: https://cip.coreblockchain.net/cip/cbc/cip-151/ +[CIP-152]: https://cip.coreblockchain.net/cip/cbc/cip-152/ ```ts import { Cip150MetadataContract, IpfsGateway } from "corebc"; @@ -59,11 +79,20 @@ const expired = lifecycle.isExpiredAt(BigInt(Math.floor(Date.now() / 1000))); const lab = await metadata.readLabCertificate(new IpfsGateway(), block); ``` -CIP-151 timestamps remain exact `bigint` Unix seconds. Missing lifecycle values impose no limit. These helpers expose metadata; enforcement of transfers or trading belongs to the contract or application. CIP-152 validation checks JSON structure, not issuer authenticity or gateway content integrity. +CIP-151 timestamps remain exact `bigint` Unix seconds. Missing lifecycle values +impose no limit. These helpers expose metadata; enforcement of transfers or +trading belongs to the contract or application. CIP-152 validation checks JSON +structure, not issuer authenticity or gateway content integrity. ## IPFS and custom units -`IpfsGateway` accepts `ipfs://CID/path`, `/ipfs/CID/path`, bare CID references, and HTTP(S) URLs. Its default template is `https://ipf.sk/{cid}`; configure another gateway with `new IpfsGateway({ template: "https://gateway.example/ipfs/{cid}" })`. JSON reads default to a 1 MiB limit and 30-second timeout. Treat metadata URLs as untrusted input; server applications should supply a `fetch` implementation that enforces their outbound network policy. +`IpfsGateway` accepts `ipfs://CID/path`, `/ipfs/CID/path`, bare CID references, +and HTTP(S) URLs. Its default template is `https://ipf.sk/{cid}`; configure +another gateway with +`new IpfsGateway({ template: "https://gateway.example/ipfs/{cid}" })`. JSON +reads default to a 1 MiB limit and 30-second timeout. Treat metadata URLs as +untrusted input; server applications should supply a `fetch` implementation that +enforces their outbound network policy. ```ts import { CustomUnitToken } from "corebc/cip"; @@ -81,11 +110,15 @@ if (units) { } ``` -Custom-unit discovery follows the Tone/Core API convention: `supportsUnit`, `supportedUnits`, `preferredUnit`, and `balanceOfUnit`. Balances and multiplier numerator/denominator stay as `bigint`; a zero canonical balance has no defined multiplier. This convention is separate from the numbered CIPs above. +Custom-unit discovery follows the Tone/Core API convention: `supportsUnit`, +`supportedUnits`, `preferredUnit`, and `balanceOfUnit`. Balances and multiplier +numerator/denominator stay as `bigint`; a zero canonical balance has no defined +multiplier. This convention is separate from the numbered CIPs above. ## Browser bundles -ESM and UMD bundles, including minified versions, are in `dist/` in the npm package. Serve them from your application: +ESM and UMD bundles, including minified versions, are in `dist/` in the npm +package. Serve them from your application: ```html ``` -The UMD bundle `dist/corebc.umd.min.js` exposes `globalThis.corebc`. Secure randomness requires a secure browser context. +The UMD bundle `dist/corebc.umd.min.js` exposes `globalThis.corebc`. Secure +randomness requires a secure browser context. ## Development @@ -103,7 +137,9 @@ npm install npm run check ``` -See [CONTRIBUTING.md](CONTRIBUTING.md) for builds, tests, CIP contributions, and release setup. Report problems or request features through the [issue forms](https://github.com/CorePass/corebc.js/issues/new/choose). +See [CONTRIBUTING.md](CONTRIBUTING.md) for builds, tests, CIP contributions, and +release setup. Report problems or request features through the +[issue forms](https://github.com/CorePass/corebc.js/issues/new/choose). ## License diff --git a/package.json b/package.json index de76d9f5..b6a5b555 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "corebc", - "version": "1.0.0", + "version": "1.1.0", "author": "CorePass", "description": "A complete and compact CoreBC library, for Dapps, wallets and any other tools.", "browser": { diff --git a/scripts/test-browser.mjs b/scripts/test-browser.mjs index 7ffe28d2..a0cc1584 100644 --- a/scripts/test-browser.mjs +++ b/scripts/test-browser.mjs @@ -34,4 +34,25 @@ for (const file of ["dist/corebc.umd.js", "dist/corebc.umd.min.js"]) { context, ); } +for (const file of ["wordlists-extra.js", "wordlists-extra.min.js"]) { + const { LangSk, LangDe } = await import( + new URL("../dist/" + file, import.meta.url) + ); + const de = LangDe.wordlist(); + if ( + de.locale !== "de" || + de.getWord(0) !== "abbau" || + de.getWordIndex("zyklus") !== 2047 + ) { + throw new Error("browser German wordlist mismatch"); + } + const sk = LangSk.wordlist(); + if ( + sk.locale !== "sk" || + sk.getWord(208) !== "chalupa" || + sk.getWordIndex("zvuk") !== 2047 + ) { + throw new Error("browser Slovak wordlist mismatch"); + } +} console.log("Browser bundle checks passed"); diff --git a/src.ts/_tests/test-wordlists.ts b/src.ts/_tests/test-wordlists.ts new file mode 100644 index 00000000..48a31809 --- /dev/null +++ b/src.ts/_tests/test-wordlists.ts @@ -0,0 +1,125 @@ +import assert from "node:assert/strict"; +import { createHash } from "node:crypto"; +import { Mnemonic, wordlists } from "../index.js"; +import { LangDe } from "../wordlists/lang-de.js"; +import { LangSk } from "../wordlists/lang-sk.js"; + +// Independently calculated SHA-256 mnemonic vectors using upstream word indices. +const vectors = [ + [ + "00000000000000000000000000000000", + "abakus abakus abakus abakus abakus abakus abakus abakus abakus abakus abakus abrazia", + ], + [ + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zvuk zaliv", + ], + [ + "000102030405060708090a0b0c0d0e0f10111213", + "abakus anjel kridlo anjel gremium akrobat cisterna clona atlet humanita favorit ciara adept lezec gorila", + ], +]; + +describe("Slovak mnemonic wordlist", () => { + it("preserves all 2048 upstream word indices", () => { + assert.equal(wordlists.sk, LangSk.wordlist()); + assert.equal(wordlists.sk.locale, "sk"); + const words = Array.from({ length: 2048 }, (_, i) => { + const word = wordlists.sk.getWord(i); + assert.equal(wordlists.sk.getWordIndex(word), i); + return word; + }); + assert.equal(new Set(words).size, 2048); + assert.equal( + createHash("sha256") + .update(words.join("\n") + "\n") + .digest("hex"), + "79b7334ea13a4ad25f7bdaf4e82075d888e81839ad69ebdf647e0467c33e0b24", + ); + assert.equal(wordlists.sk.getWord(208), "chalupa"); + assert.equal(wordlists.sk.getWordIndex("not-a-word"), -1); + for (const index of [-1, 2048, 0.5, NaN]) { + assert.throws(() => wordlists.sk.getWord(index)); + } + }); + it("matches mnemonic vectors and recovers entropy", () => { + for (const [hex, phrase] of vectors) { + const entropy = "0x" + hex; + assert.equal( + Mnemonic.fromEntropy(entropy, "", wordlists.sk).phrase, + phrase, + ); + assert.equal( + Mnemonic.fromPhrase({ phrase, wordlist: wordlists.sk }).entropy, + entropy, + ); + assert.equal(Mnemonic.isValidMnemonic(phrase, wordlists.sk), true); + assert.equal(Mnemonic.isValidMnemonic(phrase), false); + } + assert.equal( + Mnemonic.isValidMnemonic( + Array(12).fill("abakus").join(" "), + wordlists.sk, + ), + false, + ); + }); +}); + +const germanVectors = [ + [ + "00000000000000000000000000000000", + "abbau abbau abbau abbau abbau abbau abbau abbau abbau abbau abbau abdruck", + ], + [ + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus zyklus winzig", + ], + [ + "000102030405060708090a0b0c0d0e0f10111213", + "abbau ameise korn ameise fordern achse bewahren bieder anliegen gravur esstisch bereich abgrund leer flugzeug", + ], +]; + +describe("German mnemonic wordlist", () => { + it("preserves all 2048 upstream word indices", () => { + assert.equal(wordlists.de, LangDe.wordlist()); + assert.equal(wordlists.de.locale, "de"); + const words = Array.from({ length: 2048 }, (_, i) => { + const word = wordlists.de.getWord(i); + assert.equal(wordlists.de.getWordIndex(word), i); + return word; + }); + assert.equal(new Set(words).size, 2048); + assert.equal( + createHash("sha256") + .update(words.join("\n") + "\n") + .digest("hex"), + "7965dc8c6b413ccb635d3021043365e18df0367bf5413a50a069a98addfe4e1d", + ); + assert.equal(wordlists.de.getWord(2047), "zyklus"); + assert.equal(wordlists.de.getWordIndex("not-a-word"), -1); + for (const index of [-1, 2048, 0.5, NaN]) { + assert.throws(() => wordlists.de.getWord(index)); + } + }); + it("matches mnemonic vectors and recovers entropy", () => { + for (const [hex, phrase] of germanVectors) { + const entropy = "0x" + hex; + assert.equal( + Mnemonic.fromEntropy(entropy, "", wordlists.de).phrase, + phrase, + ); + assert.equal( + Mnemonic.fromPhrase({ phrase, wordlist: wordlists.de }).entropy, + entropy, + ); + assert.equal(Mnemonic.isValidMnemonic(phrase, wordlists.de), true); + assert.equal(Mnemonic.isValidMnemonic(phrase), false); + } + assert.equal( + Mnemonic.isValidMnemonic(Array(12).fill("abbau").join(" "), wordlists.de), + false, + ); + }); +}); diff --git a/src.ts/_version.ts b/src.ts/_version.ts index ee08390d..efcec189 100644 --- a/src.ts/_version.ts +++ b/src.ts/_version.ts @@ -1,2 +1,2 @@ /** The current version of corebc; keep in sync with package.json. */ -export const version: string = "1.0.0"; +export const version: string = "1.1.0"; diff --git a/src.ts/wordlists/LICENSE.german b/src.ts/wordlists/LICENSE.german new file mode 100644 index 00000000..1bdd4f54 --- /dev/null +++ b/src.ts/wordlists/LICENSE.german @@ -0,0 +1,141 @@ +This work is multi-licensed under Unlicense, CC0 and BSD-3. You can choose between one of them if you use this work. + +--- + +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. + +--- + +BSD-3-Clause + +Copyright 2022 dys2p + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src.ts/wordlists/LICENSE.slovak b/src.ts/wordlists/LICENSE.slovak new file mode 100644 index 00000000..d6417b9e --- /dev/null +++ b/src.ts/wordlists/LICENSE.slovak @@ -0,0 +1,19 @@ +CORE License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), +to to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +All distribution of the Covered Software in Source Code Form, including any +Modifications and/or Contributions must be disclosed and publicly available. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY CLAIM, DAMAGES OR +OTHER LIABILITIES, WHETHER IN AN ACTION OF A CONTRACT, TORT, OR OTHERWISE, +ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE, OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/src.ts/wordlists/lang-de.ts b/src.ts/wordlists/lang-de.ts new file mode 100644 index 00000000..2a132297 --- /dev/null +++ b/src.ts/wordlists/lang-de.ts @@ -0,0 +1,2086 @@ +import { assertArgument } from "../utils/index.js"; +import { Wordlist } from "./wordlist.js"; + +// Source: https://github.com/dys2p/wordlists-de +// Commit: 6ef31b9aefb8735a7b066592393d12843ec502cd (Unlicense). +// Source file: de-2048-v1.txt; preserve the upstream word order. +// SHA-256 of the newline-terminated list: +// 7965dc8c6b413ccb635d3021043365e18df0367bf5413a50a069a98addfe4e1d +const words = `abbau +abbild +abbruch +abdruck +abend +abfall +abflug +abgas +abgrund +abitur +abkommen +ablauf +ablehnen +abluft +abpfiff +abreise +abriss +absage +abschied +abseits +absicht +absolut +abstand +absurd +abteil +abwarten +abwehr +abzug +achse +acht +acker +adapter +ader +adler +adresse +advent +affe +agent +agieren +ahnen +ahnung +ahorn +akademie +akkord +akte +aktie +aktuell +akustik +akzent +alarm +albatros +album +alge +alkohol +allee +allianz +alltag +alpen +alptraum +alter +altglas +altstadt +alufolie +amboss +ameise +ampel +amsel +amulett +analyse +ananas +anbau +anbieten +anblick +anfang +anfrage +angabe +angel +angriff +angst +anhand +anheben +anhieb +anker +anklage +ankommt +ankunft +anlage +anleiten +anliegen +anmelden +annehmen +annonce +anomalie +anpassen +anregung +anruf +ansatz +anschein +ansehen +ansicht +anspruch +anstalt +anteil +antik +antrag +antwort +anwalt +anwesen +anwohner +anzahl +anzeige +anzug +apfel +apotheke +apparat +appell +applaus +april +aquarell +arbeit +archiv +areal +arena +argument +armband +armut +aroma +arten +artikel +arzt +asche +aspekt +asphalt +atelier +atem +athlet +atlas +atom +attacke +auerhahn +aufbau +aufgabe +auflage +aufnahme +aufruf +aufstand +auftrag +aufwand +aufzug +auge +august +auktion +aula +ausbruch +ausdruck +ausflug +ausgang +auskunft +ausnahme +aussicht +auswahl +auszug +autark +auto +avocado +baby +bach +backen +baden +bagger +bahn +baldrian +balkon +ball +balsam +bambus +banane +band +bank +bargeld +barsch +bart +basis +bass +basteln +batterie +bauch +bauer +bauland +baum +bauplan +bausatz +baut +bauwagen +bauzaun +beachten +beamte +bebauung +beben +becher +becken +bedarf +bedenken +bedienen +bedroht +beenden +beere +befahren +befehl +befinden +befragen +befund +begabt +begeben +beginn +begonnen +begriff +behalten +beide +beifall +beige +beihilfe +beil +bein +beirat +beispiel +beitrag +bekannt +bekennen +beklagen +bekommen +belasten +belegen +beliebt +belohnen +bemerkt +benannt +benutzen +benzin +bequem +beraten +bereich +berg +bericht +beruf +bescheid +besen +besitz +besorgen +besser +bestand +besuch +beton +betrieb +bett +beule +beute +bewahren +bewegen +bewirken +bewohner +bezahlen +bezirk +bezog +bezug +biber +bieder +biene +bier +biest +bieten +bilanz +bild +billig +binden +binnen +biologie +biotonne +birgt +birke +birne +bitter +blasen +blatt +blau +blech +blick +blind +blitz +block +blume +blut +boden +bogen +bohne +bohren +boje +bolzen +bombe +bonus +boot +bord +botanik +bote +boxen +boxring +boykott +brachten +brand +braten +braun +brav +brechen +brei +bremsen +brennen +brett +brief +brille +bringen +brisant +brokkoli +bronze +brosche +brot +bruch +bruder +brunnen +brust +bube +buch +bude +budget +bunker +bunt +burg +busch +busfahrt +bussard +butter +campen +caravan +chance +chaos +charme +chat +chemie +chillen +chlor +chor +chrom +clever +clown +code +computer +couch +creme +dach +damals +dame +damm +dampf +danken +darm +datei +dattel +datum +dauer +daumen +deal +debatte +decke +defekt +defizit +dehnen +deich +delfin +delle +denkmal +depot +design +dessert +detail +detektiv +deuten +devise +dezember +diagnose +dialog +dichter +dick +dieb +dienstag +diesel +digital +diktat +dilemma +dill +ding +diplomat +direktor +dirigent +diskette +distel +diverse +docht +doktor +dokument +dolch +domizil +donner +doppelt +dorf +dorn +dose +dozent +drache +draht +drama +dreck +drehbuch +drei +dringend +drohne +drossel +drucker +ducken +duell +duft +dunkel +dunst +durst +dusche +dynamik +ebbe +ebene +echo +echse +echt +ecke +efeu +effekt +egal +ehefrau +ehemann +ehepaar +ehre +ehrgeiz +ehrlich +eichel +eidechse +eier +eigentum +eile +eimer +einblick +eindruck +einfach +eingang +einheit +einigung +einkauf +einladen +einmal +einnahme +einrad +eins +eintritt +einzeln +eisberg +eisdecke +eisen +eistee +eisvogel +eiszeit +elch +elefant +elegant +element +elend +elite +elle +elster +eltern +empfang +ende +endlich +energie +engel +engpass +enkel +enorm +ensemble +ente +entgegen +entlang +entwurf +entzogen +epoche +erbe +erbracht +erbse +erdbeere +erde +erdgas +erdnuss +ereignis +erfassen +erfinden +erfolg +erfreuen +ergebnis +erhalten +erheben +erholung +erinnern +erkennen +erlauben +erlebnis +erlitten +erneut +ernst +ernte +erobern +erproben +erregen +ersatz +ersetzen +ersparen +erteilen +ertrag +erwarten +erwerben +erwiesen +erworben +erzeugen +erzielen +esel +essen +essig +esstisch +etage +etappe +etat +ethik +etikett +etliche +eule +euphorie +event +ewig +exakt +examen +exil +existenz +exkurs +experte +export +express +extern +extrem +fabel +fabrik +fach +fackel +faden +fahne +fahrrad +faktor +falke +fallen +falsch +falter +familie +fangen +fans +fantasie +farbe +farn +fasching +fass +faultier +fauna +faust +favorit +faxen +fazit +februar +fechten +feder +fegen +fehler +feier +feile +fein +feld +fell +fels +fenchel +fenster +ferien +fern +ferse +fertig +fest +fett +feucht +feuer +fichte +fieber +figur +fiktion +filiale +film +filter +filz +finale +finden +finger +fink +finster +firma +fisch +flach +flagge +flamme +flasche +fleck +fleisch +flexibel +fliege +flink +flocke +floh +flora +flucht +flugzeug +flur +fluss +flut +fokus +folge +folie +fordern +forelle +formel +forst +foto +foyer +fracht +frage +fraktion +frau +frech +freizeit +fremd +frequenz +freund +frieden +friseur +froh +front +frosch +frucht +frust +fuchs +fund +funktion +furcht +fusion +futter +gabel +galaxie +galerie +gang +ganove +gans +ganz +garage +gardine +garn +garten +gasse +gast +gattung +gauner +gazelle +geben +gebiet +geboren +gebracht +geburt +gecko +gedanke +gedicht +geduld +gefahr +gefieder +geflecht +gegend +gegner +gehen +gehirn +geier +geige +geist +geiz +gelassen +gelb +geld +gelee +gelten +gelungen +gemacht +gemein +genau +generell +genie +genug +gepard +gerade +gerecht +gericht +gern +gerste +geruch +gesamt +geschenk +gesetz +gesicht +gespenst +gestalt +gesund +getan +getreide +gewalt +gewerbe +gewitter +gewonnen +giebel +gier +gift +gigant +gipfel +gips +giraffe +girlande +gitarre +gitter +glanz +glas +glatt +glaube +gleis +glitzer +globus +glocke +glut +gnade +gold +golf +gondel +gorilla +grab +grad +grafik +gramm +granit +gras +gratis +grau +gravur +greifen +gremium +grenze +griff +grill +grinsen +groll +grotte +grube +gruft +grund +gruppe +gruselig +gulasch +gully +gummi +gunst +gurke +gurt +guthaben +haar +habgier +habicht +hacken +hafen +haft +hagel +hahn +haken +halb +halde +halle +halm +hals +halten +hammer +hamster +hand +hanger +hantel +harfe +harke +harmonie +hart +hase +haube +hauch +haufen +haus +haut +hebamme +hebel +hecht +hecke +hefe +heft +heilen +heim +heiraten +heizung +hektar +held +helfen +hell +helm +hemd +henkel +herbst +herd +hering +herkunft +herr +herz +heute +hilfe +himbeere +himmel +hinblick +hinsicht +hinten +hinweis +hirse +hirte +hitze +hobel +hoch +hoffen +hohl +holen +holunder +holz +honig +honorar +hopfen +horizont +horn +hose +hotel +hufeisen +huhn +hummer +humor +hund +hunger +hupe +husten +hydrant +hygiene +ideal +idee +idol +idyll +igel +illegal +illusion +imbiss +imker +immun +impfen +import +impuls +index +indiz +infolge +ingwer +inhalt +innen +insasse +insel +institut +internet +investor +irgendwo +ironie +irrtum +isoliert +jacht +jacke +jagd +jagen +jaguar +jahr +januar +jargon +jazz +jemand +joggen +joghurt +jubel +jugend +juli +jung +juni +jurist +jury +justiz +juwel +kabarett +kabel +kabine +kaffee +kahl +kajak +kakao +kaktus +kalender +kalt +kamera +kamin +kamm +kampf +kanal +kandidat +kanister +kanne +kante +kanu +kapelle +kapitel +kapsel +kaputt +karneval +karotte +karriere +karte +kasse +kasten +katalog +katze +kaufhaus +kauz +kegel +kehren +keks +kelch +keller +kennen +keramik +kern +kerze +kessel +ketchup +kette +keule +kiefer +kiesel +kilo +kind +kino +kiosk +kirsche +kissen +kiste +kittel +kiwi +klage +klammer +klang +klappe +klar +klasse +klavier +kleben +klee +kleid +klettern +klientel +klima +klinik +klippe +klon +klopfen +klotz +klug +knapp +kneipe +knie +knochen +knopf +knoten +koala +kochen +koffer +kohle +koje +kolibri +kollege +komisch +kommen +komplett +konflikt +konkurs +konsum +kontakt +konzert +kopf +kopie +korb +korn +korrekt +kosten +krabbe +kraft +kralle +kran +kraut +krawatte +krebs +kredit +kreis +kresse +kreuz +kriegen +krippe +krise +kritik +krokodil +krone +krug +krumm +kruste +kuchen +kugel +kuhstall +kulisse +kultur +kunde +kunst +kupfer +kurier +kurs +kurve +kurz +kuss +kutsche +label +labor +lachen +lack +laden +ladung +lager +laie +lama +lamm +lampe +land +lang +lappen +larve +lassen +last +laterne +latte +laub +lauch +laufen +laune +laut +lavendel +lawine +leben +lecker +leder +leer +legen +lehm +lehnen +lehrer +leib +leicht +leid +leim +leinwand +leiste +leiter +lektor +lemming +lenken +leopard +lernen +lesen +lesung +leuchte +leute +lexikon +libelle +licht +liebe +lied +liefern +liegen +lila +lilie +limette +linde +lineal +linie +links +lippe +liste +liter +lizenz +loch +locke +logistik +lohn +lokal +lotse +loyal +luchs +luft +lunge +lupe +lustig +luxus +lyrik +machen +made +magazin +magen +magie +magnet +mahnen +mais +malen +mama +mango +mann +mantel +marder +markt +marmor +marsch +maschine +maske +masse +mast +material +matrose +matte +mauer +maulwurf +maus +maximal +medaille +medizin +meer +mehl +mehrweg +meinung +meister +melden +melken +melone +membran +menge +mensch +mentor +merkmal +messer +metall +meter +methode +miene +mieten +milan +milch +milde +milieu +mimik +mineral +minigolf +minute +minze +mischung +mitglied +mitleid +mittag +mode +molch +moment +monat +mond +monitor +monster +montag +moos +moped +moral +morgen +motiv +motor +motte +mulde +mund +muschel +museum +musik +muskel +muster +mutig +mutter +mythos +nacht +nacken +nadel +nagel +nahrung +name +napf +narbe +narr +narzisse +nase +nashorn +nass +natter +natur +nebel +negativ +nehmen +neid +neigung +nektar +nennen +nerven +nest +nett +netz +neubau +neugier +neuland +neun +niedrig +niemand +nilpferd +niveau +nobel +nochmal +norden +normal +note +notfall +notiz +november +nudel +null +nummer +nuss +nutzen +oase +oben +objekt +obst +ofen +offen +ohne +ohren +ohrring +oktober +olive +olympia +omelett +onkel +online +oper +option +orange +ordnung +organ +orgel +original +orkan +ortsrand +ostern +otter +oval +paar +packen +paket +palast +palette +palme +panda +panik +papagei +papier +pappe +paprika +parade +park +parole +party +passage +patent +pathos +patient +pause +pavian +pech +pedal +pegel +peinlich +peitsche +pelikan +pelz +pendel +perfekt +periode +perle +person +pfad +pfahl +pfanne +pfau +pfeffer +pfeil +pferd +pfiff +pfirsich +pflaume +pflegen +pflicht +pflug +pforte +pfosten +pfote +phase +physik +picknick +pier +pigment +pille +pilot +pilz +pinguin +pink +pinnwand +pinsel +pinzette +pirat +piste +pixel +plakat +planet +plastik +platz +pleite +plus +podest +podium +poesie +pokal +politik +pollen +polster +pommes +pony +pool +portrait +positiv +post +pracht +praxis +preis +presse +prinzip +privat +probe +produkt +profil +programm +projekt +prospekt +protest +provinz +prozent +psyche +publikum +pudding +puder +puls +pulver +puma +pumpe +punkt +punsch +puppe +pute +putzen +puzzel +pyjama +pyramide +quadrat +qualle +quark +quatsch +quelle +quer +quittung +quiz +quote +rabatt +rabe +rache +radar +radio +radtour +radweg +rahmen +rakete +rampe +rand +rang +ranke +raps +rasen +rassel +rast +rasur +raten +ratgeber +rathaus +ratte +rauch +raum +raupe +raus +raute +razzia +reaktion +real +rebell +rechnen +reden +redner +referent +reform +regal +regen +region +rehkitz +reibe +reich +reifen +reihe +reim +rein +reise +reiten +reiz +rekord +rektor +relativ +rennen +rentier +reporter +reptil +reserve +residenz +resonanz +respekt +rest +resultat +retten +revier +rezept +rhythmus +richtig +riechen +riegel +riesig +rind +ring +rinnsaal +risiko +riss +ritter +ritual +ritze +robbe +roboter +rock +roggen +rohbau +rohkost +rohr +rohstoff +roller +roman +rosa +rose +rosine +rost +rotkohl +rotor +rucksack +rudel +rufen +ruhe +ruhig +ruhm +ruine +rummel +rund +runter +rute +rutsche +saal +saat +sache +sack +safran +saft +sagen +sahne +saison +salat +salbe +saloon +salz +samen +sammeln +samstag +samt +sand +sanft +saniert +sardine +satellit +satire +sattel +satz +sauber +sauer +saugen +sauna +saurier +schaf +schere +schirm +schlange +schmuck +schnee +schock +schrank +schuh +schwan +sechs +seefahrt +seehund +seekuh +seele +seestern +segel +segment +sehen +seide +seife +seil +seite +sektor +sekunde +sellerie +selten +semester +seminar +senden +senf +senior +senken +sense +serie +serum +server +sessel +setzen +shop +sichel +sieb +siedlung +sieg +signal +silber +simpel +singen +sinken +sinn +sirene +sirup +sitzen +skala +skandal +skelett +skizze +skript +skulptur +socke +sofa +sohle +sohn +soja +solide +sollen +sommer +sonne +sorge +sorte +sozial +spachtel +spagat +spalten +spange +spargel +spaten +specht +speise +spektrum +spende +sperling +speziell +spiegel +spinne +spion +spitze +sponsor +sport +sprache +sprechen +springen +sprotte +sprung +spur +stabil +stachel +stadt +stahl +stall +stamm +standort +stapel +stark +station +staub +stecken +steg +stehen +stein +stellen +stempel +steppe +stern +stetig +steuer +stichtag +stier +stift +still +stimme +stirn +stock +stoff +stolz +stoppen +storch +strand +strecke +strich +strom +strumpf +stube +stuck +studium +stufe +stuhl +stumm +stunde +sturm +substanz +suche +summe +sumpf +suppe +surfen +symbol +symptome +system +szenario +tabelle +tabu +tacker +tadel +tafel +tagebuch +takt +talent +talfahrt +tango +tank +tanne +tante +tanz +tapfer +tapir +tarif +tarnen +tasche +tasse +tastatur +tatort +tatsache +taube +tauchen +tausch +taxi +team +technik +teekanne +teer +teesieb +teich +teig +teilen +telefon +teller +tempo +tendenz +tennis +tenor +teppich +termin +terrasse +test +teuer +text +theater +thema +theorie +therapie +these +tief +tier +tiger +tinte +tipp +tisch +titel +tochter +toilette +toleranz +toll +tomate +tonband +tonne +topf +torbogen +torte +torwart +total +tracht +tragen +training +trapez +trasse +traum +treffen +treiben +trennen +treppe +tresor +treten +treu +triangel +trick +trinken +trocken +trommel +tropfen +trost +trubel +truhe +trumpf +trunk +truthahn +tuch +tukan +tulpe +tunnel +turbine +turm +turnen +tusche +typisch +ufer +uhrwerk +umbau +umbruch +umfang +umfeld +umfrage +umgang +umgebung +umhang +umkreis +umland +umriss +umsatz +umschlag +umsetzen +umsonst +umstand +umwelt +umzug +unfall +unikat +unmut +unrat +unrecht +unruhe +unschuld +unsinn +unten +unweit +urkunde +urlaub +ursache +ursprung +urteil +utopie +vage +vakuum +vanille +variante +vase +vater +ventil +veranda +verband +verdacht +verein +verfall +verkehr +verloren +vernunft +verrat +verstand +vertrag +verwandt +verzicht +video +vieh +viel +vier +villa +virus +vision +vitamine +vitrine +vogel +voliere +voll +volumen +vorbild +vorfall +vorgabe +vorhang +vorlage +vorn +vorort +vorrat +vorsicht +vortrag +vorwurf +votum +vulkan +waage +wachs +wade +waffel +wagen +waggon +wahl +wahrheit +wald +walnuss +walross +walze +wand +wanne +wanze +wappen +ware +warm +warnung +warten +warze +waschen +wasser +webstuhl +wechsel +wecker +wedel +weggabel +wehren +weich +weide +wein +weisheit +weit +weizen +welken +welle +welpe +welt +wende +wenig +werbung +werfen +werkzeug +wert +wesen +wespe +weste +wetter +wichtig +widder +wiegen +wiese +wild +wille +wimper +wind +winkel +winter +winzig +wippe +wirbel +wirkung +wirt +wischen +wisent +wissen +witz +woche +wohl +wohnen +wolf +wolke +wolle +wort +wunder +wunsch +wurm +wurzel +zacke +zahl +zahm +zahn +zander +zange +zapfen +zart +zauber +zaun +zebra +zeche +zecke +zehe +zehn +zeichen +zeigen +zeile +zeit +zelle +zelt +zement +zensur +zentrum +zettel +zeug +ziege +ziehen +ziel +ziffer +zimmer +zimt +zins +zipfel +zirkus +zitat +zitrone +zocken +zollfrei +zone +zorn +zucchini +zucker +zufall +zuflucht +zugang +zugriff +zukunft +zunge +zusatz +zuschlag +zustand +zutat +zwang +zweck +zwei +zwiebel +zwilling +zwingen +zwirn +zyklus`.split("\n"); + +let wordlist: null | LangDe = null; + +/** German community mnemonic wordlist from dys2p/wordlists-de. */ +export class LangDe extends Wordlist { + constructor() { + super("de"); + } + + getWord(index: number): string { + assertArgument( + Number.isInteger(index) && index >= 0 && index < words.length, + `invalid word index: ${index}`, + "index", + index, + ); + return words[index]; + } + + getWordIndex(word: string): number { + return words.indexOf(word); + } + + static wordlist(): LangDe { + if (wordlist == null) { + wordlist = new LangDe(); + } + return wordlist; + } +} diff --git a/src.ts/wordlists/lang-sk.ts b/src.ts/wordlists/lang-sk.ts new file mode 100644 index 00000000..77154b6c --- /dev/null +++ b/src.ts/wordlists/lang-sk.ts @@ -0,0 +1,2086 @@ +import { assertArgument } from "../utils/index.js"; +import { Wordlist } from "./wordlist.js"; + +// Source: https://github.com/rastislavcore/slovak-wordlist +// Commit: f7e436a9956875de8230b0ef242ded53376b47f7 (CORE License). +// Generated with upstream build.js; preserve its custom CH ordering. +// SHA-256 of the newline-terminated list: +// 79b7334ea13a4ad25f7bdaf4e82075d888e81839ad69ebdf647e0467c33e0b24 +const words = `abakus +abatis +abeceda +abrazia +absces +absorber +abstrakt +acetat +adept +adjektiv +admiral +adoracia +adresa +advent +advokat +aerobik +agave +agent +agnostik +agogika +agonia +agregat +agronom +akademia +akcent +akcia +akne +akord +akrobat +akrylen +aktivum +aktovka +akty +akuzativ +akvarium +alarm +album +alchymia +aldehyd +alegoria +aleluja +algebra +alibi +aligator +alkyon +almanach +alobal +aloe +alternat +amalgam +ambasada +amen +ametyst +amok +amplion +amulet +anabaza +analogia +ananas +anarchia +anatomia +andante +andezit +anhydrid +anjel +anonym +antena +antilopa +antonym +antracit +apartman +apendix +apetit +aplauz +apofyza +apostol +apropo +arasid +archa +areal +arena +argument +aroma +asfalt +aspekt +ataman +atase +atlas +atlet +atom +atrakcia +auto +avion +avivaz +avizo +avokado +axel +axioma +azbest +azimut +azyl +baba +babika +babka +bahno +bakteria +balik +balkon +balon +bambus +banan +banda +baptista +barbar +barel +baroko +basta +batalion +baterka +batoh +bazant +bazen +bazilika +bedac +bedla +beletria +benzin +beseda +besnota +beton +beznadej +biatlon +biblia +biceps +bicik +bicykel +bidet +bidlo +bieda +bielko +bilancia +biliard +biolog +biomasa +birmovka +biskup +bistro +bitka +biznis +bizon +blaho +blamaz +blana +blatnik +blcha +blesk +blizkost +blok +blond +bludisko +bluf +bobor +bocian +bodak +bodka +bodliak +bohac +bohem +boje +bolero +bordel +borec +borovica +bota +boxer +bozk +bralo +breh +bremeno +breza +brigada +briketa +brko +brloh +brnenie +brod +bronz +broskyna +brucho +bryndza +brzda +bublina +bubon +buda +budik +buket +buldozer +bulvar +bumerang +bunker +buran +burina +burka +bylina +byvol +cadic +cajka +cakaren +chalupa +chaos +chapadlo +capik +capko +charita +caro +casnik +casopis +castica +chata +cech +ceder +cedidlo +cela +celenka +celibat +celok +celuloza +celzius +cement +chemia +cencul +cengot +cent +cenzura +cepiec +cerpadlo +ceruzka +cesnak +cesta +cezia +ciapka +ciara +cibula +cicavec +ciel +cieva +cifernik +cigara +cimbal +chimera +chinin +cinnost +cintorin +cipka +cirkus +cisar +cislo +cisterna +citron +city +civil +chlad +clanok +clenka +chlieb +clnok +clona +chlopna +chlp +cmar +chmel +cnost +chobot +chodba +cokolada +cholera +colnici +choroba +corpus +chovatel +chram +chrbat +chren +crepina +chripka +chrobak +chrup +ctitel +chudoba +cudzinec +cuketa +cukor +cukrik +chuligan +chumac +cumak +cunami +curbes +chut +chvat +cvicenie +chvila +chvost +chyba +cyklus +cylinder +cynik +chyzna +dabing +damping +daniar +danost +darca +darebak +databaza +datel +dativ +davka +dazd +dcera +debakel +debet +debna +decht +decibel +dedina +dedko +dedo +defekt +deficit +deflacia +dejepis +dejisko +dekor +dekret +delegat +delfin +delirium +delta +demagog +demisia +demon +dennik +dentista +derby +deres +derivat +desatoro +destilat +detail +detektor +deti +deva +dezen +diagram +diakon +dialog +diamant +diar +diaspora +diesel +dieta +dievca +difuzia +dikcia +diktat +dilema +dimenzia +dioxid +diplom +disk +divadlo +diviak +divoch +dizajn +dlaha +dlazka +dlhopis +dlzka +doba +dobytok +docent +dodavka +dogma +dohoda +dojem +dojnica +dokaz +doklad +doktor +dokument +dolina +dolomit +domcek +domena +domino +domov +donor +dopad +dopyt +dosah +doska +dostihy +dotacia +dotyk +dovtip +dravec +drazba +dren +drevo +drina +drobcek +drogeria +drozd +drzgros +dubak +duchna +duel +duha +dukat +dumbier +duplikat +dusno +dusok +duznina +dvere +dvojca +dvor +dych +dyka +dynamit +dzban +dzem +dzokej +dzus +eden +edicia +editor +edukacia +efekt +egoista +egres +eidam +ekliptik +ekolog +ekonom +ekotyp +ekzem +elaborat +elan +elastika +eldorado +elegan +elektron +element +elevator +elfovia +elipsa +elita +elixir +embargo +emblem +embolia +embryo +emental +emirat +emocia +empatia +emulzia +encian +endonym +energia +enigma +enklava +entita +enzym +epidemia +epigram +epika +epilacia +epitaf +epizoda +epocha +epopeja +epos +epoxid +erar +erby +erekcia +erozia +erupcia +esej +esencia +eskadra +eskorta +espreso +estetika +estrada +etalon +etapa +etiketa +etnikum +etologia +etuda +etylen +euforia +eunuch +evakuant +evolucia +exemplar +exil +exkurzia +exmanzel +exonyma +exotika +expanzia +explozia +export +expres +exterier +extra +fabrika +fakir +fakla +faktor +fakulta +falos +falz +familia +fanatik +fantom +fanusik +faraon +farba +farmacia +farnost +fasada +fascikel +fasirka +faul +favorit +fazula +feferon +fejton +fenomen +fermez +feromon +fesak +festival +feudal +fialka +fiasko +figa +figel +figura +fikus +filc +filialka +filozof +filter +financie +finta +firma +fiskal +fistula +fitnes +fixacia +fixka +fjord +flanel +flasa +flauta +flora +flotila +folia +folklor +fond +fonema +fonograf +fontana +formula +fortuna +forum +fosfat +fosilie +fotka +foto +fragment +frajer +fraska +fraza +fregata +front +fujara +funkcia +furik +futbal +fuzia +fuzy +fyzika +gagor +gajdy +galaxia +galeria +galiba +galosa +gamba +garbiar +garda +garsonka +gaspar +gastan +gate +gauc +gazela +gejzir +geneza +genius +genofond +geolog +gepard +gerbera +gigant +gitara +glazura +globus +gloria +glosa +glukoza +gobelin +golf +golier +gombik +gondola +gong +goral +gorila +gotika +gradacia +grafika +graham +grant +gratis +gremium +grep +gril +grimasa +grizly +grobian +grog +groteska +grun +gula +gulocka +gunar +guraz +gurman +guru +guverner +gyroskop +habit +hacik +hadanka +hadica +hadka +hadr +hadzana +hajnik +halda +halier +halogen +halusky +hanba +handra +hangar +hardver +harfa +harlekyn +harmonia +harpuna +hasak +hasic +haslerka +havran +hazard +hektar +heligon +helma +hemendex +herbar +herec +hermelin +herna +hertz +hesla +hetrik +hever +hexagon +historia +hladina +hlas +hlava +hlbka +hliadka +hlien +hlina +hlodavec +hltan +hluk +hluza +hmat +hmla +hmota +hmyz +hnev +hniezdo +hnoj +hnus +hnutie +hoblik +hodiny +hodnota +hodvab +hody +hojdacka +hokej +holen +holic +hologram +holub +homar +honorar +hora +horcica +horizont +horko +hormon +hornina +horucava +hospodar +hostina +hotel +hotovost +hovado +hovor +hrable +hracka +hrad +hrana +hrasok +hrazda +hrca +hrdlo +hrdost +hrdza +hreben +hrianka +hrib +hriech +hriva +hrncek +hrniec +hrobka +hroch +hrot +hrozno +hruda +hruska +huba +hudba +hudobnik +humanita +humbug +humno +humor +husle +hustota +hutnik +hvezdar +hviezda +hydina +hydrant +hygiena +hypoteka +hysteria +idea +identita +idiom +idol +idyla +igelit +iglu +ihla +ihlicnan +ihned +ihrisko +ikona +ikra +iluzia +imanie +imelo +imidz +imitacia +imperium +import +impresia +impulz +imunita +incident +index +indicia +indukcia +inflacia +infuzia +ingot +injekcia +inkaso +inotaj +inovacia +instinkt +integral +intimita +intriga +intuicia +invazia +investor +inzerat +inzinier +ironia +iskra +istic +istota +izba +izomer +izotop +jablko +jachta +jacmen +jadro +jaguar +jahna +jalovica +jamka +jantar +jarabina +jarmok +jarok +jaskyna +jasle +jastrab +javisko +jazdec +jazero +jazva +jazyk +jedalen +jedinec +jedlo +jednota +jelito +jelsa +jemnost +jesen +jezko +jezuita +joga +jojo +jubilant +judo +junak +junior +jupiter +jura +jurta +justicia +kabat +kabel +kabina +kachle +kacica +kadet +kadidlo +kahan +kajak +kajuta +kakao +kaki +kaktus +kalamita +kalcium +kalendar +kalich +kalkul +kaloria +kaluz +kalvaria +kamarat +kamen +kampan +kamuflaz +kamzik +kanal +kancelar +kandela +kanistra +kankan +kanoe +kanton +kapacita +kapela +kapitan +kaplnka +kapor +kapsula +kapusta +karate +karbon +kardinal +karfiol +kariera +karma +karneval +kaskada +kasmir +kastiel +katalog +katedra +kation +katoda +kaucia +kauza +kaviar +kavovar +kazajka +kazeta +kecup +kefa +kefir +kefka +keks +kelimok +kemp +kengura +keramika +kimono +kiosk +kladivo +klakson +klarinet +klasika +klaun +klavir +klby +klebeta +klenot +klepeto +kliatba +klietka +kliniec +klip +klobuk +klub +kluce +klzisko +knaz +knedla +knieza +kniha +koalicia +koberec +kobyla +koce +kocka +kocur +kofein +kohut +kojot +kokos +kolac +koleno +koliba +kolmica +kolok +kombajn +komedia +komik +komora +kompas +konanie +koncert +kondicia +konecna +konflikt +kongres +koniec +konkurz +kontext +konvica +konzul +kopanice +kopec +kopija +kopula +kopytnik +korba +koren +koruna +koryto +korzet +kosa +kosela +kostol +kotlik +kotol +kotva +kozusina +kradez +krajina +kralik +krater +kraul +kravata +krcma +krdel +kredit +kreker +kremacia +kresba +kreveta +krhla +kridlo +kriza +kroj +krtko +kruh +krupica +kryha +kryt +kucera +kuchyna +kultura +kupa +kupola +kurier +kurz +kutac +kuzel +kuzlo +kvotacia +kyselina +labut +labyrint +ladovec +lady +laguna +lahkost +lahoda +laik +laket +lakomec +laktoza +lalia +lalok +lamela +lampa +langos +lanovka +lapaj +laser +lasica +lastura +latex +latrina +lava +lavina +lavor +lazaret +lebka +leco +legenda +legionar +lehota +lejak +lekar +lekcia +lekno +lenoch +leopard +lepidlo +lesenie +lesnik +lest +letisko +letokruh +levica +lexikon +lezec +leziak +liana +liatina +libela +lice +lider +lido +liek +lienka +lietadlo +lievik +limba +limit +limuzina +linia +lipa +lisovna +lista +litanie +loby +lodenica +logika +lokalita +loksa +lolo +lopata +lopta +lopuch +losos +loteria +lovec +lozisko +lozko +ludia +luna +lupez +luxus +lyko +lyra +lyze +mach +maciatko +madam +maglajz +magma +magnet +majitel +majoneza +majster +maketa +makkys +makler +makovica +makro +malba +maliar +maly +mama +manazer +mandla +manzel +maraton +marhula +marka +marod +masaz +maslo +maso +mastal +material +matica +matoha +matrix +mece +medaila +meduza +medved +medzera +melon +mena +mensina +meranie +mesiac +mesto +metal +meteorit +metla +metoda +metro +miazga +mierka +miesto +mikrofon +miliarda +milnik +milost +minca +minister +minutka +miska +mlada +mlieko +mnich +mnozina +mobil +mociar +model +modla +mohyla +mokrina +molekula +moment +monitor +monolog +moralka +morca +more +most +motor +motuz +motyl +mozaika +moznost +mozog +mramor +mrav +mrkva +mroz +mrtvola +mrzak +mucnik +mudrc +muflon +mulica +municia +muzeum +muzika +mydlo +mysel +mysi +myto +mytus +nacrt +nadej +nadoba +nadpis +nadsenec +nadvorie +nadych +nafta +naivnost +nakova +nakup +nalada +nalepka +namestie +nano +napatie +napln +napoj +naradie +narcis +narek +naruc +naskok +nasyp +nater +natierka +nausnica +navnada +navod +navrat +nazor +nebesa +nebo +nechty +negativ +neglize +nehoda +nenavist +neon +neopren +nepravda +nerez +netopier +netvor +neuroza +neutron +nevadza +nevola +nezmysel +nikel +nizina +noblesa +noha +nomad +nonsens +norka +notar +noviny +noznice +nuansa +nugat +nylon +oaza +obal +obava +obcan +obchod +obdlznik +obdobie +obed +obilie +objekt +obklad +oblak +obmena +obraz +obrna +obrubnik +obuv +obyvatel +ocean +ocel +ocot +odber +odboj +odbyt +odev +odlet +odozva +odpad +odpor +odstup +odvaha +odznak +ohen +okale +okno +okrasa +okres +okular +okupacia +olej +oliva +oltar +omacka +omietka +opacha +opar +opera +opica +orbit +orchidea +orech +organ +orgovan +orol +ortut +oska +osoba +ostrov +otazka +otec +otras +ovad +ovca +ovcie +ovocie +ozvena +pachatel +pacidlo +padak +pahyl +pajac +palivo +pamat +pamiatka +pandemia +panel +panva +papagaj +papez +papier +paplon +paprad +parabola +parcela +park +partia +paska +pastva +pavuk +pazerak +pazucha +pecen +pechota +pedagog +peha +pekaren +peniaze +peracnik +perina +pesiak +petrzlen +pevnost +piano +piesok +pilier +pirana +piroh +pirsing +pismeno +pivo +plagat +planeta +plast +plavak +plazma +plech +plesen +plod +plostica +pluca +pluh +plural +plyn +pobrezie +pobyt +pocasie +pocitac +podiel +podnik +podorys +podrazka +podvod +poezia +pohar +pohlad +pokrok +pokuta +polcas +poldecak +pole +polica +polnoc +polyglot +pomaranc +pomoc +pomsta +ponorka +popcorn +poprava +porcelan +porod +posol +posta +potapac +poter +potkan +potok +potvora +povraz +poziar +praca +prak +pramen +prapor +pravda +predajna +prekazka +premavka +pretekar +preukaz +priamka +pricina +prihoda +priklad +prilba +princ +priorita +pripad +pristroj +pritok +prives +prizemie +problem +procesor +program +proton +proza +prsten +prut +pruzina +pstros +pucik +pumpa +punc +pupava +pupok +pust +puta +pycha +pytlik +pyton +rabin +rada +radio +radost +ragby +rakva +ramena +ranc +rasca +rast +reakcia +realita +rebel +rebro +recept +redkovka +referat +regal +rehot +reklama +rekord +remen +repa +replika +retaz +retus +rezak +rezim +riadenie +riasa +rieka +riesenie +ringlota +ritual +rivalita +riziko +rizoto +rodeo +rolak +rolnik +ropovod +rovina +rovnost +rozhodca +rozkrok +rozmarin +rozpocet +rozum +ruch +rukola +ruksak +ruky +rumancek +rusen +ruza +ryba +rybka +rychlost +rytier +rytmus +sabotaz +sadlo +sadra +sadze +saga +sakal +salka +samit +samota +sampinon +samuraj +sandal +sanky +sarkan +sasanka +satelit +sauna +savana +saxofon +sebaklam +sebec +sedliak +segment +sejf +sekera +sekunda +semafor +senator +sendvic +seno +serum +servis +sezona +sfera +signal +sija +simpanz +singular +sinus +sirena +sirka +sirota +sito +situacia +skala +skandal +skatula +skener +skica +sklenik +sklo +skoba +skok +skrat +skrupina +skuska +skutok +skvrna +slad +slahacka +slanina +slavik +slecna +slnko +slnovrat +sloboda +slon +slovo +sluch +sluha +sluzba +slzy +smec +smelost +smeti +smiech +smirgel +smola +smotana +smrek +smrst +smyk +snaha +sneh +snura +sobas +socha +sociolog +sodik +sofer +softver +sokol +solnicka +sonar +sonet +sopa +sopka +sosovica +spachtla +spageta +spalna +sparno +spenat +spev +spln +spojka +spona +sport +sposob +spot +sprcha +spust +squash +srdce +srnach +srsen +srvatka +stado +stajna +stan +stastena +stavba +stazen +steblo +stedrost +stena +stetec +stigma +stit +stlp +stodola +stojan +stol +stonozka +stopa +strava +stred +strk +strom +strucik +stryc +studna +stupen +stuzka +stvrt +subjekt +suboj +sucasnik +sucho +sucit +sudca +sudkyna +suhaj +suhlas +sukna +sultan +suma +sumec +super +surovina +sused +susto +sutaz +suteren +svadba +svagor +sval +svedok +svet +sviecka +svihadlo +svist +svokra +svorka +sykorka +symbol +synergia +syntax +tabak +tablo +tabor +tabu +tacka +tago +tajomnik +takt +talent +talizman +tanec +tango +tanier +tapeta +tarifa +taxik +tazenie +tchor +tehla +tekvica +telefon +telo +tema +temnota +tempo +teoretik +teplota +tepna +terasa +tesar +text +tien +tiesnava +tiger +tiraz +titan +titul +tlac +tlama +tlcik +tlmocnik +tobogan +topanka +topol +tovar +trajekt +traktor +tranzit +trasa +trener +treska +trieda +trik +tringelt +tromf +tron +trubka +trud +trzba +trznica +tsunami +tucniak +tundra +tunel +tuniak +turban +turista +turnaj +tuzka +tvaroh +tyfus +tykadlo +tyrkys +ucastnik +ucen +ucho +ucitel +udaj +udolie +uhlie +uhor +ukazka +ulica +uloha +umenie +umysel +unia +unikat +upal +upir +upon +uraz +urbar +urok +uroven +usek +usmev +uspech +usta +utecenec +uterak +utlm +utopia +utrata +utroby +uzas +uzaver +uzda +uzemie +uzera +uzitok +uzivatel +uzol +uzovka +vacsina +vagabund +vaha +vajce +vakuum +valach +valcik +valec +vankus +vapnik +varecha +vavrin +vazba +vcela +vchod +vdaka +vdova +vecer +veci +vedec +vedro +veduci +veko +vektor +velitel +velkost +velryba +vemeno +vers +veslo +vesmir +vestibul +vetva +vichor +video +vidlica +viecha +viera +vieska +vietor +vikend +viking +vila +vineta +vino +visna +vitamin +vitraz +vklad +vkus +vlajka +vlak +vlasy +vlhko +vlna +vlocka +vnuk +voda +vodca +vodic +vodopad +vodzka +vojak +vojvoda +vokan +volba +volfram +votrelec +vozidlo +vplyv +vrabec +vrba +vrch +vrece +vrkoc +vrsok +vrstva +vrtulnik +vtip +vulkan +vybor +vybuch +vychod +vycvik +vydra +vydych +vyhlad +vyhna +vymena +vynimka +vynos +vyrazka +vyrobca +vysielac +vyska +vysledok +vystava +vytah +vyvojka +vyzbroj +vyziva +vyzla +vzduch +vzor +xenon +xylofon +zabava +zaber +zaciatok +zaclona +zahrada +zaklad +zakruta +zaliv +zaloha +zalud +zamok +zapas +zapcha +zaplata +zaprah +zarez +zarmutok +zaruka +zastava +zatka +zaujem +zavet +zavin +zavoj +zazrak +zazvor +zbabelec +zbierka +zbojnik +zbor +zdravie +zebra +zehlicka +zelen +zemiak +zemla +zenich +zeriav +zerucha +zgrlos +ziadost +ziak +zihlava +ziletka +zima +zincica +zips +zirafa +zistenie +zivocich +zlato +zlet +zliatina +zlodej +zlom +zlosyn +zltok +zmena +zmes +zmija +zmluva +zmrzlina +znamenie +zobak +zobrak +zoldnier +zona +zoologia +zornica +zostatok +zosun +zoznam +zradca +zralok +zreb +zrenica +zrieba +zrkadlo +zrno +zrucnost +zubac +zurnal +zuvacka +zvar +zviera +zvitok +zvon +zvuk`.split("\n"); + +let wordlist: null | LangSk = null; + +/** Slovak mnemonic wordlist from rastislavcore/slovak-wordlist. */ +export class LangSk extends Wordlist { + constructor() { + super("sk"); + } + + getWord(index: number): string { + assertArgument( + Number.isInteger(index) && index >= 0 && index < words.length, + `invalid word index: ${index}`, + "index", + index, + ); + return words[index]; + } + + getWordIndex(word: string): number { + return words.indexOf(word); + } + + static wordlist(): LangSk { + if (wordlist == null) { + wordlist = new LangSk(); + } + return wordlist; + } +} diff --git a/src.ts/wordlists/wordlists-extra.ts b/src.ts/wordlists/wordlists-extra.ts index 766f60b1..9afc96c4 100644 --- a/src.ts/wordlists/wordlists-extra.ts +++ b/src.ts/wordlists/wordlists-extra.ts @@ -6,3 +6,5 @@ export { LangKo } from "./lang-ko.js"; export { LangIt } from "./lang-it.js"; export { LangPt } from "./lang-pt.js"; export { LangZh } from "./lang-zh.js"; +export { LangSk } from "./lang-sk.js"; +export { LangDe } from "./lang-de.js"; diff --git a/src.ts/wordlists/wordlists.ts b/src.ts/wordlists/wordlists.ts index e8ff3e95..1f8b041f 100644 --- a/src.ts/wordlists/wordlists.ts +++ b/src.ts/wordlists/wordlists.ts @@ -1,4 +1,5 @@ import { LangCz } from "./lang-cz.js"; +import { LangDe } from "./lang-de.js"; import { LangEn } from "./lang-en.js"; import { LangEs } from "./lang-es.js"; import { LangFr } from "./lang-fr.js"; @@ -6,6 +7,7 @@ import { LangJa } from "./lang-ja.js"; import { LangKo } from "./lang-ko.js"; import { LangIt } from "./lang-it.js"; import { LangPt } from "./lang-pt.js"; +import { LangSk } from "./lang-sk.js"; import { LangZh } from "./lang-zh.js"; import type { Wordlist } from "./wordlist.js"; @@ -14,9 +16,9 @@ import type { Wordlist } from "./wordlist.js"; * The available Wordlists by their * [ISO 639-1 Language Code](link-wiki-iso639). * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), + * (**i.e.** [cz](LangCz), [de](LangDe), [en](LangEn), [es](LangEs), [fr](LangFr), * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) + * [sk](LangSk), [zh_cn](LangZh), [zh_tw](LangZh)) * * The dist files (in the ``/dist`` folder) have had all languages * except English stripped out, which reduces the library size by @@ -25,11 +27,13 @@ import type { Wordlist } from "./wordlist.js"; */ export const wordlists: Record = { cz: LangCz.wordlist(), + de: LangDe.wordlist(), en: LangEn.wordlist(), es: LangEs.wordlist(), fr: LangFr.wordlist(), it: LangIt.wordlist(), pt: LangPt.wordlist(), + sk: LangSk.wordlist(), ja: LangJa.wordlist(), ko: LangKo.wordlist(), zh_cn: LangZh.wordlist("cn"),