rsa_id_number 0.1.2 copy "rsa_id_number: ^0.1.2" to clipboard
rsa_id_number: ^0.1.2 copied to clipboard

A package that provides easy-to-use Dart utilities for validating and generating South African ID numbers, ensuring accuracy and compliance with the ID number format. Whether you need to verify existi [...]

example/example.dart

import 'dart:developer';

import 'package:rsa_id_number/rsa_id_number.dart';

void main() {
  /// Validate
  String idToValidate = '9202204720082';
  bool isValid = RsaIdValidator.isValid(idToValidate);
  log('Is valid ID: $isValid');

  /// Generation a random/valid SA id number
  String rsaIdNumber = RsaIdGenerator.generate();
  log('Generated ID: $rsaIdNumber');

  /// generate with options
  String rsaIdNumber2 = RsaIdGenerator.generate(
    gender: Gender.FEMALE,
    citizenship: Citizenship.CITIZEN_BORN,
    maxDate: DateTime(1969, 1, 1),
    minDate: DateTime.now(),
  );
  log('Generated with opts: $rsaIdNumber2');
}
8
likes
0
points
191
downloads

Publisher

verified publishermakhosandile.me

Weekly Downloads

A package that provides easy-to-use Dart utilities for validating and generating South African ID numbers, ensuring accuracy and compliance with the ID number format. Whether you need to verify existing IDs or create random ones, this package simplifies the process.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

intl, luhn_algorithm, meta

More

Packages that depend on rsa_id_number