Skip to content

A simple PHP package that manages code verification while being UI & DB agnostic. It only aims on providing an API for generating cryptographic codes and verifying between two given codes elegantly.

License

Notifications You must be signed in to change notification settings

codelabmw/testament

Repository files navigation

Testament

GitHub Workflow Status (master) Total Downloads Latest Version License


A UI & DB agnostic PHP package for code generation and verification. It only aims on providing an API for generating cryptographic codes and verifying between two given codes elegantly.

Requires PHP 8.3+

Installation

You can install the package via composer:

composer require codelabmw/testament

Usage

<?php

$testament = new \Codelabmw\Testament\Testament::default();

$code = $testament->generate(
  type: \Codelabmw\Testament\Enums\CodeType::NUMERIC /* code type - numeric | alpa | alphanumeric | password */,
  length: 8 /* number of characters */
);

$codeFromUser = getUserCode();
$codeFromStorage = getStorageCode();

$verified = $testament->verify(
  expected: $codeFromUser /* ... */,
  actual: $codeFromStorage /* ... */,
);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

A simple PHP package that manages code verification while being UI & DB agnostic. It only aims on providing an API for generating cryptographic codes and verifying between two given codes elegantly.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages