{"id":24567302,"url":"https://github.com/autonomoussoftware/fast-password-entropy","last_synced_at":"2025-04-22T12:51:01.104Z","repository":{"id":48894439,"uuid":"124988036","full_name":"autonomoussoftware/fast-password-entropy","owner":"autonomoussoftware","description":"Calculate the entropy of a password string, but fast!","archived":false,"fork":false,"pushed_at":"2021-07-06T17:49:26.000Z","size":167,"stargazers_count":26,"open_issues_count":1,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-08T10:52:11.691Z","etag":null,"topics":["entropy","javascript","password"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autonomoussoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-03-13T03:39:28.000Z","updated_at":"2024-06-21T18:26:32.000Z","dependencies_parsed_at":"2022-09-18T05:47:00.173Z","dependency_job_id":null,"html_url":"https://github.com/autonomoussoftware/fast-password-entropy","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/autonomoussoftware%2Ffast-password-entropy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomoussoftware%2Ffast-password-entropy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomoussoftware%2Ffast-password-entropy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomoussoftware%2Ffast-password-entropy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autonomoussoftware","download_url":"https://codeload.github.com/autonomoussoftware/fast-password-entropy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250243839,"owners_count":21398407,"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":["entropy","javascript","password"],"created_at":"2025-01-23T13:17:40.095Z","updated_at":"2025-04-22T12:51:00.969Z","avatar_url":"https://github.com/autonomoussoftware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fast-password-entropy\n\n[![Build Status](https://travis-ci.org/autonomoussoftware/fast-password-entropy.svg?branch=master)](https://travis-ci.org/autonomoussoftware/fast-password-entropy)\n[![Code Style](https://img.shields.io/badge/code%20style-bloq-0063a6.svg)](https://github.com/bloq/eslint-config-bloq)\n[![Known Vulnerabilities](https://snyk.io/test/github/autonomoussoftware/fast-password-entropy/badge.svg?targetFile=package.json)](https://snyk.io/test/github/autonomoussoftware/fast-password-entropy:package.json) [![Greenkeeper badge](https://badges.greenkeeper.io/autonomoussoftware/fast-password-entropy.svg)](https://greenkeeper.io/)\n\nCalculate the entropy bits of a string as a quick proxy to password strength.\n\nSee [Entropy as a measure of password strength](https://en.wikipedia.org/wiki/Password_strength#Entropy_as_a_measure_of_password_strength) for more information.\n\n## Installation\n\n```bash\n$ npm install --save fast-password-entropy\n```\n\n## Usage\n\n```js\nconst stringEntropy = require('fast-password-entropy')\n\nconsole.log(stringEntropy('1234')) // 13\nconsole.log(stringEntropy('password')) // 38\n```\n\n### ES5 support\n\nA transpiled version is available in `es5/index.js`. To use that specific version, this syntax is also supported:\n\n```js\nvar stringEntropy = require('fast-password-entropy/es5');\n```\n\n## Research\n\nSeveral libraries were analyzed before creating this one. Some of those are listed below, along with the drawbacks found for each one.\n\n[`information-entropy`](https://www.npmjs.com/package/information-entropy): Too basic. Cannot extract charset length from the string being tested.\n\n[`joi-password-complexity`](https://github.com/kamronbatman/joi-password-complexity): Interesting but not providing raw entropy information.\n\n[`passwd-strength`](https://github.com/tcort/passwd-strength): Values are correct but is too slow.\n\n[`password-entropy`](https://www.npmjs.com/package/password-entropy): Entropy calculation is not following any standard so results are very different from other libs.\n\n[`password-strength`](https://github.com/yuehu/password-strength): Only giving \"simple\", \"medium\", \"strong\" values.\n\n[`string-entropy`](https://github.com/mvhenten/string-entropy): Provides good entropy values but is slow.\n\n[`tai-password-strength`](https://github.com/tests-always-included/password-strength): Very complex and results are not fully matching the expected results.\n\n[`zxcvbn`](https://github.com/dropbox/zxcvbn): Uses comprehensive heuristics to estimate complexity but solves a much more complex problem instead.\n\n## Benchmark\n\nAfter the research, only three libraries were analyzed in detail and benchmarked. This library results are 3.5x faster than the existing libraries.\n\n```\n$ npm run bench\n\nTest strings [ '',\n  '8646',\n  'xtcmFWoH',\n  'Lp2x0P1iMEPWZKaQ',\n  'escape piece useful cloth',\n  'needle excitement over aloud price among',\n  'topic contain anything political great thank dawn among butter doll fought end' ]\n\nResults for `fast-password-entropy`   [ 0, 13, 46, 95, 147, 235, 459 ]\nResults for `passwd-strength`       [ 0, 13, 46, 95, 147, 235, 459 ]\nResults for `password-entropy`      [ 1, 1, 3, 10, 10, 10, 10 ]\nResults for `string-entropy`        [ 0, 13, 46, 95, 118, 188, 367 ]\nResults for `tai-password-strength` [ 0, 6, 24, 62, 87, 152, 312 ]\n\nBenchmarking...\nfast-password-entropy x 557,198 ops/sec ±1.27% (87 runs sampled)\npasswd-strength x 1,732 ops/sec ±4.36% (81 runs sampled)\nstring-entropy x 143,412 ops/sec ±3.92% (83 runs sampled)\ntai-password-strength x 11,590 ops/sec ±1.28% (86 runs sampled)\n\nFastest is fast-password-entropy\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautonomoussoftware%2Ffast-password-entropy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautonomoussoftware%2Ffast-password-entropy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautonomoussoftware%2Ffast-password-entropy/lists"}