{"id":22404475,"url":"https://github.com/1mehdifaraji/luhnsoft","last_synced_at":"2026-01-29T11:36:19.566Z","repository":{"id":265870846,"uuid":"896784237","full_name":"1mehdifaraji/luhnsoft","owner":"1mehdifaraji","description":"Implementing Luhn Algorithm to validate credit cards, IMEI etc.","archived":false,"fork":false,"pushed_at":"2024-12-01T09:52:48.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T09:43:13.595Z","etag":null,"topics":["credit-card","imei","javascript","luhn","luhn-algorithm","npm-package","typescript","validation"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/luhnsoft","language":"TypeScript","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/1mehdifaraji.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-12-01T09:52:31.000Z","updated_at":"2024-12-01T15:59:31.000Z","dependencies_parsed_at":"2024-12-01T09:55:56.024Z","dependency_job_id":null,"html_url":"https://github.com/1mehdifaraji/luhnsoft","commit_stats":null,"previous_names":["1mehdifaraji/luhnsoft"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/1mehdifaraji/luhnsoft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mehdifaraji%2Fluhnsoft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mehdifaraji%2Fluhnsoft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mehdifaraji%2Fluhnsoft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mehdifaraji%2Fluhnsoft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1mehdifaraji","download_url":"https://codeload.github.com/1mehdifaraji/luhnsoft/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1mehdifaraji%2Fluhnsoft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28876737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["credit-card","imei","javascript","luhn","luhn-algorithm","npm-package","typescript","validation"],"created_at":"2024-12-05T10:13:16.957Z","updated_at":"2026-01-29T11:36:19.543Z","avatar_url":"https://github.com/1mehdifaraji.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Luhnsoft\n\nThis library implements [Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) to validate credit cards, IMEI [etc](https://en.wikipedia.org/wiki/Luhn_algorithm#Uses). It does support string (english, arabic or persian digits) or number as an input. It's also typed with typescript with zero dependency.\n\n# Usage\n\nFirst install the package with `npm` or `yarn` or `pnpm`.\n\n```bash\nnpm install luhnsoft\n```\n\nor\n\n```bash\nyarn add luhnsoft\n```\n\nor\n\n```bash\npnpm add luhnsoft\n```\n\nThen import `validate` from `luhnsoft` and put in the credit card or IMEI digits as an input.\n\n```typescript\nimport validate from 'luhnsoft';\n\nconst isValid: boolean = validate(3570861********);\n```\n\n# API\n\n- You can use `string` or `number` type digits.\n- The `validate` function already converts `arabic` and `persian` digits to `english` and makes sure all extra characters are removed so you don't need to worry about removing characters like `-` or empty spaces from input beforehand.\n\n# Testing\n\nThe tests are written with `vitest` that can be used to verify the package before usage.\n\n# Contributing\n\nPlease submit an [issue](https://github.com/1mehdifaraji/luhnsoft/issues) or a [pull request](https://github.com/1mehdifaraji/luhnsoft/pulls) If you have any issues or ideas with the library.\n\n# Author\n\n[Mehdi Faraji](https://github.com/1mehdifaraji)\n\n# License (MIT)\n\nCopyright (c) 2024 Mehdi Faraji\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1mehdifaraji%2Fluhnsoft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1mehdifaraji%2Fluhnsoft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1mehdifaraji%2Fluhnsoft/lists"}