Token generator and signature validator
yarn add @sudoo/token
# Or
npm install @sudoo/token --save
import { generateKeyPair, KeyPair, SignatureCreator } from "@sudoo/token";
const keyPair: KeyPair = generateKeyPair();
const creator: SignatureCreator = SignatureCreator.instantiate(keyPair.private);
const token: string = creator.sign("Hello World");
import { KeyPair, SignatureVerifier } from "@sudoo/token";
// Also get your generated key pair
const verifier: SignatureVerifier = SignatureVerifier.instantiate(keyPair.public);
const result: string = verifier.verify("Hello World", "<Generated Token>");