jwt-lib-test

0.0.3 • Public • Published

jwt-lib

A cryptocurrency-compliant js library 一个实现符合加密货币的js库

Based on jsontokens library (https://github.com/stacks-network/jsontokens-js). 基于jsontokens库进行扩展。

INSTALL

npm install jwt-lib-test

Code demonstration

import walletJwt from "jwt-lib-test"

const wallet = walletJwt.generate();
console.log(wallet);
const data = {
  header:{
    time: new Date().toString(),
  },
  payload:{
    sub: '1234567890',
    name: 'John Doe',
  }
};
const sign = walletJwt.signOfjwt(data, wallet.privateKey);
console.log(sign);
console.log(walletJwt.decodeOfjwt(sign));
console.log(walletJwt.verifyOfjwt(sign, wallet.compressPubKey));

Readme

Keywords

none

Package Sidebar

Install

npm i jwt-lib-test

Weekly Downloads

0

Version

0.0.3

License

ISC

Unpacked Size

18.3 kB

Total Files

10

Last publish

Collaborators

  • cc.