This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@truestamp/id
TypeScript icon, indicating that this package has built-in type declarations

1.4.1 • Public • Published

Truestamp ID

Description

A Truestamp ID serialize/deserialize library written in Typescript and simple command line ID parse tool.

ID Structure

  • The ID is typically ~64 characters in length. This exact length is not guaranteed.
  • The ID default prefix is always ts_, it is stripped during ID parsing and can be removed.
  • The body of the ID is Base58Check encoded.
  • The Base58Check decoded bytes decoded, validated and checked against a keyed SipHash Message Authentication Code (MAC) to help prevent forgery of IDs or DoS attacks.

Installation

npm install @truestamp/id

Example Code

There is an example for Node.js in the /examples directory.

npm run build
cd examples/node
npm i
node index.js

CLI

There is a very simple CLI that will decode a Truestamp ID and display the data stored within it.

$ ./bin/truestamp-id.cjs ts_11RuhkBx6tQHcsRtbtJcn5TU232Fp9NP7D3DsH65FX6B5nEWXNx7UjMR4nAo
{
  test: false,
  timestamp: '1640995200000000',
  ulid: '01G9ZMQHC1ZAGJNF52AEZ0AGYV'
}

Contributing

  • Commit changes, merge PR's to main branch
  • Bump version field in package.json
  • Cut a new release
  • New release will trigger workflow to build, test, and publish private package to Github Package Registry.

Legal

Copyright © 2021-2022 Truestamp Inc. All Rights Reserved.

Package Sidebar

Install

npm i @truestamp/id

Weekly Downloads

2,004

Version

1.4.1

License

UNLICENSED

Unpacked Size

1.14 MB

Total Files

18

Last publish

Collaborators

  • truestamp-dev