Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@emurgo/cip14-js

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emurgo/cip14-js

A Javascript library reference implementation for CIP14

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.2K
decreased by-18.6%
Maintainers
3
Weekly downloads
 
Created
Source

CIP14-JS

On the Cardano blockchain, native assets are uniquely identified by both their policy id and asset name. Neither the policy id nor the asset name are intended to be human-readable data. CIP14 introduces an asset fingerprint which is a short(er) and human-readable identifier for assets that user can recognize and refer to when talking about assets.

More specifically, CIP14 defines a user-facing asset fingerprint as a bech32-encoded blake2b-160 digest of the concatenation of the policy id and the asset name.

This package is a Typescript implementation of CIP14

Install

npm i @emurgo/cip14-js --save

Usage

const AssetFingerprint = require('@emurgo/cip14-js');

// initialize class with policyId, assetName
const assetFingerprint = new AssetFingerprint(Buffer.from('1e349c9bdea19fd6c147626a5260bc44b71635f398b67c59881df209', 'hex'), Buffer.from('504154415445', 'hex'));

const fingerprintHash = assetFingerprint.hash();
const bech32Fingerprint = assetFingerprint.fingerprint();
// initialize class with bech32
const assetFingerprint = new AssetFingerprint().fromBech32('asset1rjklcrnsdzqp65wjgrg55sy9723kw09mlgvlc3');

const fingerprintHash = assetFingerprint.hash();
const prefix = assetFingerprint.prefix();

FAQs

Package last updated on 23 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc