{"id":20244280,"url":"https://github.com/protonmail/bip39","last_synced_at":"2025-04-10T20:43:52.913Z","repository":{"id":44645828,"uuid":"391901809","full_name":"ProtonMail/bip39","owner":"ProtonMail","description":"JavaScript implementation of Bitcoin BIP39","archived":false,"fork":false,"pushed_at":"2022-02-02T11:51:00.000Z","size":917,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-10-16T00:32:51.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProtonMail.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-02T10:14:41.000Z","updated_at":"2024-01-04T23:08:56.000Z","dependencies_parsed_at":"2022-09-13T15:41:11.832Z","dependency_job_id":null,"html_url":"https://github.com/ProtonMail/bip39","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Fbip39","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Fbip39/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Fbip39/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Fbip39/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProtonMail","download_url":"https://codeload.github.com/ProtonMail/bip39/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248294158,"owners_count":21079794,"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-14T09:14:01.552Z","updated_at":"2025-04-10T20:43:52.891Z","avatar_url":"https://github.com/ProtonMail.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BIP39\n\nJavaScript implementation of [Bitcoin BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki).\n\n## Installation\n\nAdd the following to dependencies in `package.json`\n\n```json\n\"bip39\": \"github:ProtonMail/bip39#semver:PACKAGE_VERSION\",\n```\n\n## Example Usage\n\n```ts\nimport { entropyToMnemonic, mnemonicToEntropy, validateMnemonic } from 'bip39';\n\nconst entropy = new Uint8Array(16); // Use a CSPRNG to generate the random bytes\n// =\u003e Uint8Array(16) [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … ]\n\nconst mnemonic = await entropyToMnemonic(entropy);\n// =\u003e abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\n\nconst recoveredEntropy = await mnemonicToEntropy(mnemonic);\n// =\u003e Uint8Array(16) [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … ]\n\nconst isValid = await validateMnemonic(mnemonic);\n// =\u003e true\n```\n\n## API\n\n### `entropyToMnemonic`\n\nTakes `Uint8Array` entropy and outputs a mnemonic based on the wordlist.\n\n### `mnemonicToEntropy`\n\nTakes a mnemonic and outputs the `Uint8Array` entropy.\n\n### `validateMnemonic`\n\nValidates a given mnemonic. Returns `true` if valid and `false` if invalid.\n\n### wordlist\n\nEach function can take a wordlist - a string array of length 2048. If a wordlist is not specified, it will default to [English](https://github.com/ProtonMail/bip39/blob/main/src/wordlists/english.json).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonmail%2Fbip39","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotonmail%2Fbip39","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonmail%2Fbip39/lists"}