gisostallenberg/fixed-token

There is no license information available for the latest version (1.0.0) of this package.

Generates and verifies tokens based on a secret and some public data

1.0.0 2017-01-27 15:41 UTC

This package is auto-updated.

Last update: 2024-11-24 04:58:01 UTC


README

Generate and verify tokens based on a secret and some public data

Installation

composer require gisostallenberg/fixed-token

Usage example

<?php

use GisoStallenberg\FixedToken\FixedToken;

$secret = 'oxQu/H2FZLOK2elkfle8bg./eg';
$data = array(
    'username' => 'giso',
);

$token = FixedToken::create($secret)
    ->addData($data)
    ->generate();

FixedToken::create($secret)
    ->addData($data)
    ->verify($token); // should return true