Download the PHP package marjovanlier/southafricanidvalidator without Composer

On this page you can find all versions of the php package marjovanlier/southafricanidvalidator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package southafricanidvalidator

South African ID Validator

Table of Contents

Introduction

The SouthAfricanIDValidator PHP package is your comprehensive solution for validating South African ID numbers, crucial for any application processing or verifying South African identities. Validation of ID numbers is essential, as it ensures that IDs adhere to both specific structural and contextual standards outlined in South African identity documentation. This package stands out for its ease of use, high accuracy, and thorough validation checks, including structure and format validation, birth date verification, gender, citizenship status, and race indicator digits, and applying the Luhn algorithm for checksum digit validation.

Badges

CI OSV-Scanner Packagist Version Packagist Downloads Packagist License PHP from Packagist Latest Stable Version PHPStan Enabled Phan Enabled Psalm Enabled codecov

Features

System Requirements

Installation

Getting Started

To begin using the SouthAfricanIDValidator in your project, follow these steps:

  1. Install via Composer - Run the following command to install the package:

  2. Basic Usage Example - After installation, South African ID numbers may be validated with the following code:

To integrate the SouthAfricanIDValidator into your project, install it via Composer:

South African ID Number Format

A South African ID number is a 13-digit number with the format: YYMMDDSSSSCAZ

Historical Context

The 13-digit ID number system was first introduced with the green bar-coded ID book in 1980, replacing the older 9-digit system. The system was then legally codified by the Identification Act 72 of 1986.

Pre-1980 ID Format (Not supported by this validator)

The blue "Book of Life" (1972-1979) used a 9-digit number plus a race letter:

Note: Black South Africans were issued separate "Reference Books" with different serial numbers and were not included in the blue Book of Life system.

Key Differences

When the 13-digit system was introduced in 1980, it was issued to all citizens including elderly adults, which is why valid IDs can contain birth dates from the 1800s.

Usage

To validate a South African ID number, instantiate the SouthAfricanIDValidator class and call the luhnIDValidate method:

Return Values

The luhnIDValidate method returns:

Troubleshooting

Should you encounter issues, the following solutions address common problems:

For additional assistance or to report an issue, please refer to the GitHub issue tracker.

Testing

First, ensure you have all the necessary development dependencies installed by running composer install --dev. Then, run the following command to execute the unit tests included with the package:

Contributing

We value your contributions to the SouthAfricanIDValidator package! Here's how you can help:

  1. Report Issues or Suggest Enhancements - Noticed a bug or have an idea to make the package better? Start by filing an issue on our GitHub repo. This lets us discuss possible changes before you start coding.

  2. Contribute Code - Fork the repo, then create a new branch for your work, adhering to our branching strategy guidelines. This keeps things organised and ensures consistency across contributions.

  3. Follow Our Coding Standards - Write clean, readable code that adheres to the project coding standards. This ensures consistency and maintainability.

  4. Write or Update Tests - Ensure reliability by writing tests for new features or updating existing tests where required.

  5. Submit a Pull Request - Upon completion of changes, open a pull request against the main branch with a comprehensive explanation of the modifications and their rationale.

Contributions are essential to the continued improvement of the SouthAfricanIDValidator package.

License Information

The SouthAfricanIDValidator is proudly open-sourced under the MIT Licence. This licence allows you to use, modify, distribute and contribute back to the package, both in private and commercial projects, but you must include the original copyright and license notice in any copy of the software. For full details about your rights and obligations, refer to the License File.

Recent Improvements

The validator has been enhanced with the following improvements:

Enhanced Validation

Code Quality

Release Notes

Please refer to the GitHub Releases page for the latest updates.


All versions of southafricanidvalidator with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
marjovanlier/stringmanipulation Version ^2.0.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marjovanlier/southafricanidvalidator contains the following files

Loading the files please wait ....