{"id":22096493,"url":"https://github.com/uphold/tin-validator","last_synced_at":"2025-07-24T22:32:01.589Z","repository":{"id":64017166,"uuid":"43806698","full_name":"uphold/tin-validator","owner":"uphold","description":"Validate and mask a U.S. Taxpayer Identification Number (TIN)","archived":false,"fork":false,"pushed_at":"2023-04-09T21:27:33.000Z","size":17,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-06-27T20:50:36.633Z","etag":null,"topics":[],"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/uphold.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2015-10-07T09:37:38.000Z","updated_at":"2024-08-12T19:19:35.000Z","dependencies_parsed_at":"2024-06-19T01:41:37.679Z","dependency_job_id":"00fb4982-3eac-4d00-8c15-c0d303d1458c","html_url":"https://github.com/uphold/tin-validator","commit_stats":null,"previous_names":["seegno/tin-validator"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/uphold/tin-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Ftin-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Ftin-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Ftin-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Ftin-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uphold","download_url":"https://codeload.github.com/uphold/tin-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Ftin-validator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266913680,"owners_count":24005579,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-01T04:11:14.429Z","updated_at":"2025-07-24T22:32:01.306Z","avatar_url":"https://github.com/uphold.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tin-validator\nValidate and mask a U.S. Taxpayer Identification Number (TIN). A TIN may be an Employer Identification Number (EIN), an Individual Taxpayer Identification Number (ITIN) or a Social Security number (SSN).\n\n## Status\n[![npm version][npm-image]][npm-url] [![build status][travis-image]][travis-url]\n\n## Installation\nInstall the package via `npm`:\n\n```sh\nnpm install tin-validator --save\n```\n\n## Usage\n### `isValid(value)`\nThis method validates if the given value is a valid `Taxpayer Identification Number`.\n\n#### Arguments\n1. `value` _(*)_: The value to validate.\n\n#### Returns\n_(boolean)_:  Returns whether the input value is a valid TIN or not.\n\n#### Example\n\n```js\nisValid({});\n// =\u003e false\n\nisValid('9-0-0700000');\n// =\u003e false\n\nisValid('900-70-0000');\n// =\u003e true\n\nisValid('900700000');\n// =\u003e true\n```\n\n--------------------------------------------------------------------------------\n\n### `mask(value)`\nThis method will help you protect this sensitive piece of information by obfuscating some digits.\n\n#### Arguments\n1. `value` _(*)_: The value to mask.\n\n#### Returns\n_(string)_: Returns the masked value by replacing value certain digits by 'X'.\n\n#### Example\n\n```js\nmask({});\n// Throws an Error.\n\nmask('9-0-0700000');\n// Throws an Error.\n\nmask('900-70-0000');\n// =\u003e XXX-XX-0000\n\nmask('900700000');\n// =\u003e XXXXX0000\n```\n\n--------------------------------------------------------------------------------\n\n### `sanitize(value)`\nThis method will remove all non numeric characters from the value.\n\n#### Arguments\n1. `value` _(*)_: The value to sanitize.\n\n#### Returns\n_(string)_: Returns the sanitized value containing only numeric characters.\n\n#### Example\n\n```js\nsanitize('9-0 0700000');\n// =\u003e 900700000\n\nsanitize('900a7#$0foobar0000');\n// =\u003e 900700000\n```\n\n--------------------------------------------------------------------------------\n\n## Tests\nTo test using a local installation of `node.js`:\n\n```sh\nnpm test\n```\n\nTo test using Docker exclusively:\n\n```sh\ndocker-compose run --rm sut\n```\n\n## Release\n\n```sh\nnpm version [\u003cnewversion\u003e | major | minor | patch] --message \"Release %s\"\n```\n\n## License\nMIT\n\n[npm-image]: https://img.shields.io/npm/v/tin-validator.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/tin-validator\n[travis-image]: https://img.shields.io/travis/seegno/tin-validator.svg?style=flat-square\n[travis-url]: https://img.shields.io/travis/seegno/tin-validator.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuphold%2Ftin-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuphold%2Ftin-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuphold%2Ftin-validator/lists"}