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

ton-crypto

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ton-crypto

[![Version npm](https://img.shields.io/npm/v/ton-crypto.svg?logo=npm)](https://www.npmjs.com/package/ton-crypto)

  • 1.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23K
increased by16.62%
Maintainers
1
Weekly downloads
 
Created
Source

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");

React Native

To make it work on react native some native modules are required: expo install expo-standard-web-crypto

import { polyfillWebCrypto } from 'expo-standard-web-crypto';
polyfillWebCrypto();

Hashing

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

FAQs

Package last updated on 04 Oct 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