{"id":19664875,"url":"https://github.com/small-tech/eff-diceware-passphrase","last_synced_at":"2026-06-05T20:31:53.472Z","repository":{"id":57160989,"uuid":"342731708","full_name":"small-tech/eff-diceware-passphrase","owner":"small-tech","description":"EFF Diceware Passphrase module forked from Emil Bay’s excellent module of the same name.","archived":false,"fork":false,"pushed_at":"2021-03-04T11:57:30.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-15T01:35:44.953Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/small-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-27T00:04:42.000Z","updated_at":"2021-03-04T11:54:50.000Z","dependencies_parsed_at":"2022-09-05T20:22:31.939Z","dependency_job_id":null,"html_url":"https://github.com/small-tech/eff-diceware-passphrase","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Feff-diceware-passphrase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Feff-diceware-passphrase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Feff-diceware-passphrase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Feff-diceware-passphrase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/small-tech","download_url":"https://codeload.github.com/small-tech/eff-diceware-passphrase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240732843,"owners_count":19848755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T16:19:27.468Z","updated_at":"2025-02-27T03:43:24.071Z","avatar_url":"https://github.com/small-tech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EFF Diceware Passphrase\n\n__Forked from Emil Bay’s excellent module of the same name.__\n\nThis is a single-file ESM version of Emil’s excellent module that also removes the sodium-native dependency. Instead, it employs a bring-your-own-crypto approach where you pass a reference to Node’s default crypto module when using the module under Node and it automatically detects and uses the Web Crypto API when running in the browser.\n\n## Install\n\n```\nnpm i @small-tech/eff-diceware-passphrase\n```\n\n## Examples\n\n### Node.js\n\n```js\nimport crypto from 'crypto'\nimport EFFDicewarePassphrase from '@small-tech/eff-diceware-passphrase'\n\nconst generate = new EFFDicewarePassphrase(crypto)\nconst passphrase1 = generate.words(8)\nconst passphrase2 = generate.entropy(100)\n\nconsole.log('8 words:', passphrase1.join(' '))\nconsole.log('100 bits of entropy:', passphrase2.join(' '))\n```\n\n(You can find this example in and run it from the _examples/node_ folder.)\n\n### Browser\n\n```html\n\u003c!doctype html\u003e\n\u003chtml lang='en'\u003e\n\u003chead\u003e\n  \u003cmeta charset='UTF-8'\u003e\n  \u003cmeta name='viewport' content='width=device-width, initial-scale=1.0'\u003e\n  \u003ctitle\u003eEFF Diceware Passphrase\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003ch1\u003eEFF Diceware Passphrase Example\u003c/h1\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003cstrong\u003e8 words:\u003c/strong\u003e \u003cspan id='passphrase1'\u003e\u003c/span\u003e\u003c/li\u003e\n    \u003cli\u003e\u003cstrong\u003e100 bits of entropy:\u003c/strong\u003e \u003cspan id='passphrase2'\u003e\u003c/span\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n  \u003cscript type=\"module\"\u003e\n    import EFFDicewarePassphrase from './eff-diceware-passphrase.min.js'\n\n    const generate = new EFFDicewarePassphrase()\n    const passphrase1 = generate.words(8)\n    const passphrase2 = generate.entropy(100)\n\n    document.getElementById('passphrase1').innerText = passphrase1.join(' ')\n    document.getElementById('passphrase2').innerText = passphrase2.join(' ')\n  \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nYou can find this example (along with a copy of the minified module bundle) in the _examples/browser_ folder.\n\n## Bundling\n\nAfter you’ve installed the dev dependencies using `npm i`, you can build a single-file ESM bundle by running:\n\n```sh\nnpm run build\n```\n\nOr, for the minified version:\n\n```sh\nnpm run build-minified\n```\n\nFind the bundles in the _dist_ folder.\n\nThe non-minified version is 88kb in size and the minified one is 79kb. The bulk of the size comes from the EFF word list itself, which is 77kb.\n\n## Like this? Fund us!\n\n[Small Technology Foundation](https://small-tech.org) is a tiny, independent not-for-profit.\n\nWe exist in part thanks to patronage by people like you. If you share [our vision](https://small-tech.org/about/#small-technology) and want to support our work, please [become a patron or donate to us](https://small-tech.org/fund-us) today and help us continue to exist.\n\n## Copyright\n\n -  ⓒ 2021 [Aral Balkan](https://ar.al), [Small Technology Foundation](https://small-tech.org)\n - ⓒ 2016-2021, [Emil Bay](https://github.com/emilbayes)\n - See [LICENSE](./LICENSE) for complete list of notices.\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmall-tech%2Feff-diceware-passphrase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmall-tech%2Feff-diceware-passphrase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmall-tech%2Feff-diceware-passphrase/lists"}