Socket
Socket
Sign inDemoInstall

@polkadot/wasm-crypto

Package Overview
Dependencies
16
Maintainers
2
Versions
564
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @polkadot/wasm-crypto

A wasm interface layer for use by @polkadot/util-crypto


Version published
Weekly downloads
91K
decreased by-11.7%
Maintainers
2
Install size
2.26 MB
Created
Weekly downloads
 

Changelog

Source

7.3.2 Dec 6, 2023

Changes:

  • Apply fixes for OOB array access

Readme

Source

@polkadot/wasm-crypto

Wrapper around crypto hashing functions

Usage

Install the package (also requires @polkadot/util for TextEncoder polyfills - not included here as a dependency to keep the tree lean)

yarn add @polkadot/wasm-crypto @polkadot/util

Use it -

import { u8aToHex } from '@polkadot/util';
import { bip39Generate, bip39ToSeed, waitReady } from '@polkadot/wasm-crypto';

// first wait until the WASM has been loaded (async init)
await waitReady();

// generate phrase
const phrase = bip39Generate(12);

// get ed25519 seed from phrase
const seed = bip39ToSeed(phrase, '');

// display
console.log('phrase:', phrase);
console.log('seed:', u8aToHex(seed));

FAQs

Last updated on 06 Dec 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc