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

blake3-wasm

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blake3-wasm

BLAKE3 hashing for JavaScript: WebAssembly bindings only

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
665K
increased by4.75%
Maintainers
1
Weekly downloads
 
Created

What is blake3-wasm?

The blake3-wasm package provides WebAssembly (WASM) bindings for the BLAKE3 cryptographic hash function, which is known for its high speed and security. This package allows you to leverage the performance benefits of WASM to compute BLAKE3 hashes efficiently in JavaScript environments.

What are blake3-wasm's main functionalities?

Hashing a string

This feature allows you to compute the BLAKE3 hash of a given string. The code sample demonstrates how to hash the string 'hello world' and output the result in hexadecimal format.

const blake3 = require('blake3-wasm');
const hash = blake3.hash('hello world');
console.log(hash.toString('hex'));

Hashing a file

This feature allows you to compute the BLAKE3 hash of a file. The code sample demonstrates how to read a file into a buffer and then compute its BLAKE3 hash, outputting the result in hexadecimal format.

const fs = require('fs');
const blake3 = require('blake3-wasm');
const fileBuffer = fs.readFileSync('path/to/file');
const hash = blake3.hash(fileBuffer);
console.log(hash.toString('hex'));

Incremental hashing

This feature allows you to perform incremental hashing, which is useful for hashing data that is received in chunks. The code sample demonstrates how to create a hasher, update it with multiple chunks of data, and then compute the final hash.

const blake3 = require('blake3-wasm');
const hasher = blake3.createHasher();
hasher.update('hello');
hasher.update(' ');
hasher.update('world');
const hash = hasher.digest();
console.log(hash.toString('hex'));

Other packages similar to blake3-wasm

Keywords

FAQs

Package last updated on 09 Oct 2022

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