JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 41597
  • Score
    100M100P100Q191547F
  • License MIT

Package Exports

  • ton-crypto

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ton-crypto) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

TON crypto

Version npm

Cross-platform crypto primitives for building apps for TON blockchain. Uses native crypto available in NodeJS or in browser.

Features

  • 🦺 Crypto primitives: SHA-256, SHA-512, PBKDF2-SHA-256, HMAC-SHA-512
  • 🚀 Promise-based API
  • 🏎 Built on top of Buffer (polifil required in browsers)
  • 🍰 No reimplemented crypto

Install

yarn add ton-crypto buffer

Browser polifil

// Add before using library
require("buffer");

Methods

All methods accept strings or Buffers as arguments.

import { sha256, sha512, pbkdf2_sha512, hmac_sha512 } from 'ton-crypto';
const hash1 = await sha256('hello-world');
const hash2 = await sha512(Buffer.from('hello-world', 'utf-8'));
const key = await pbkdf2_sha512('password', 'salt', 10000, 64);
const hmac = await hmac_sha512('hmac-key', 'data');

License

MIT