{"id":21064556,"url":"https://github.com/christopheralphonse/passgen","last_synced_at":"2025-03-14T01:32:18.144Z","repository":{"id":232720352,"uuid":"785020465","full_name":"ChristopherAlphonse/PassGen","owner":"ChristopherAlphonse","description":"Created this for fast ID creation for personal projects","archived":false,"fork":false,"pushed_at":"2024-08-19T03:40:51.000Z","size":337,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T20:51:55.276Z","etag":null,"topics":["passgenerator","security","uuid"],"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/ChristopherAlphonse.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-11T02:58:15.000Z","updated_at":"2024-08-19T03:40:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"e2aa0057-f2b4-42eb-987e-9b81f90a6f6f","html_url":"https://github.com/ChristopherAlphonse/PassGen","commit_stats":null,"previous_names":["christopheralphonse/passgen"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristopherAlphonse%2FPassGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristopherAlphonse%2FPassGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristopherAlphonse%2FPassGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristopherAlphonse%2FPassGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChristopherAlphonse","download_url":"https://codeload.github.com/ChristopherAlphonse/PassGen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243507507,"owners_count":20301857,"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":["passgenerator","security","uuid"],"created_at":"2024-11-19T17:50:01.416Z","updated_at":"2025-03-14T01:32:18.116Z","avatar_url":"https://github.com/ChristopherAlphonse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **PassGen**\n\nThe `PassGen` class utility designed to facilitate the generation of secure passwords and unique identifiers. It offers various methods for generating cryptographic hashes, secret keys, and unique IDs with customizable complexity levels.\n\n\n\n### Methods\n\n- **`hash(key: string): string`**\n  - **Description**: Generates a hash from the provided `key` combined with a timestamp. Returns a string in the specified base (`LEVEL`).\n  - **Parameters**:\n    - `key`: The input string to hash.\n  - **Returns**: A padded hash string.\n\n- **`generateSecret(length: number = 32): string`**\n  - **Description**: Generates a random alphanumeric secret of the specified `length`.\n  - **Parameters**:\n    - `length` (optional): The length of the generated secret (default is 32).\n  - **Returns**: A random secret string.\n\n- **`generateID(): string`**\n  - **Description**: Creates a unique identifier combining a hash, a UUID, and a random secret.\n  - **Returns**: A string in the format `hashValue-uuidValue-secretKey`.\n\n## Running the code\n\n```bash\nyarn \n```\n*to see output*\n```bash\nyarn dev\n```\n## Usage Example\n```js\nconst myPass = new PassGen(16);\nconst genID = myPass.generateID();\nconst hashValue = myPass.hash('this is a secret key?');\nconst secretKey = myPass.generateSecret();\n\nconsole.log({ genID, hashValue, secretKey, myPass });\n```\n\n```bash\n{\n  genID: '-7e9f954b-5794a534-9221-475a-842a-c7e8504fb509-Nprvndx',\n  hashValue: '2361ad49',\n  secretKey: 'zp9az7ljTw',\n  myPass: PassGen { value: 8191, LEVEL: 16, timestamp: 1724038646122n }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristopheralphonse%2Fpassgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristopheralphonse%2Fpassgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristopheralphonse%2Fpassgen/lists"}