{"id":16671997,"url":"https://github.com/zeraphie/passwordgen","last_synced_at":"2026-05-06T19:34:45.039Z","repository":{"id":57090083,"uuid":"65545307","full_name":"zeraphie/passwordGen","owner":"zeraphie","description":"Simple class for cryptographically strong secure password generation","archived":false,"fork":false,"pushed_at":"2017-08-03T09:46:38.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T04:41:09.506Z","etag":null,"topics":["composer","cryptographic","cryptography","javascript","keyspace","password","password-generator","passwordgen","php"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/zeraphie.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":"2016-08-12T10:30:31.000Z","updated_at":"2017-03-30T10:58:54.000Z","dependencies_parsed_at":"2022-08-20T16:00:56.875Z","dependency_job_id":null,"html_url":"https://github.com/zeraphie/passwordGen","commit_stats":null,"previous_names":["lopeax/passwordgen"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeraphie%2FpasswordGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeraphie%2FpasswordGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeraphie%2FpasswordGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeraphie%2FpasswordGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeraphie","download_url":"https://codeload.github.com/zeraphie/passwordGen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318758,"owners_count":20272144,"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":["composer","cryptographic","cryptography","javascript","keyspace","password","password-generator","passwordgen","php"],"created_at":"2024-10-12T12:04:48.817Z","updated_at":"2025-12-12T05:01:48.660Z","avatar_url":"https://github.com/zeraphie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PasswordGen\n\nA simple class for cryptographically strong secure password generation\n\n## Installation - Composer\nThis class is available as a package using composer, just run\n```bash\ncomposer require zeraphie/passwordgen\n```\n\n### Javascript\nThis also comes as an bower package written in javascript, compiled with gulp as it uses ES2015 for a class structure and thusly has almost exactly the same usage\n\nTo install it, run\n```bash\nbower install passwordgen\n```\n## Usage\n### Setup\n#### PHP\n```php\n// Require the autoloader\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\nuse PasswordGen\\PasswordGen;\n$passwordGen = new PasswordGen();\n```\n#### Javascript\nSimply add the [build/master.js](build/master.js) file to your build tool or add the file directly into your html and it will be ready to be used as below\n\n### Basic\n#### PHP\n```php\necho $passwordGen-\u003epassword();\n```\n#### JavaScript\n```javascript\nconsole.log(new PasswordGen().password);\n```\n\n### Changing the length\n#### PHP\n```php\necho $passwordGen-\u003esetLength(32)-\u003epassword();\n```\n#### JavaScript\n```javascript\nconsole.log(new PasswordGen().setLength(32).password);\n```\n\n### Changing the keyspace\n#### PHP\n```php\necho $passwordGen-\u003esetKeyspace('abcdefghijklmnopqrstuvwxyz')-\u003epassword();\n```\n#### JavaScript\n```javascript\nconsole.log(new PasswordGen().setKeyspace('abcdefghijklmnopqrstuvwxyz').password);\n```\n\n### Generating a keyspace\n#### PHP\n```php\necho $passwordGen-\u003egenerateKeyspace('lunsw')-\u003epassword();\n```\n#### JavaScript\n```javascript\nconsole.log(new PasswordGen().generateKeyspace('lunsw').password);\n```\n\n### Changing length and generating keyspace\n#### PHP\n```php\necho $passwordGen-\u003esetLength(32)-\u003egenerateKeyspace('lunsw')-\u003epassword();\n```\n#### JavaScript\n```javascript\nconsole.log(new PasswordGen().setLength(32).generateKeyspace('lunsw').password);\n```\nNote: The two setters are independent of each other so don't need to be in order\nNote 2: Since the javascript version utilizes static getters, you can simply use (as an example to see the character sets used in the generator) `PasswordGen.CHARACTERSETS` in order to see what the properties of the class are.\nYou can also use `PasswordGen.arrayKeySearch(needles, haystack)` and `PasswordGen.randomInteger(min, max)`\n\n## Character Groups\n| Group               | Variable                     | Letter |\n|---------------------|------------------------------|--------|\n| LOWERCASELETTERS    | 'abcdefghijklmnopqrstuvwxyz' | l      |\n| UPPERCASELETTERS    | 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | u      |\n| NUMBERS             | '1234567890'                 | n      |\n| SPECIALCHARACTERS   | '!@#$%\u0026*?,./\\|[]{}()'        | s      |\n| WHITESPACE          | ' '                          | w      |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeraphie%2Fpasswordgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeraphie%2Fpasswordgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeraphie%2Fpasswordgen/lists"}