🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@chainsafe/as-sha256

Package Overview
Dependencies
Maintainers
9
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainsafe/as-sha256

An AssemblyScript implementation of SHA256

1.2.0
latest
Source
npm
Version published
Weekly downloads
228K
26.68%
Maintainers
9
Weekly downloads
 
Created
Source

as-sha256

ES Version Node Version

AssemblyScript implementation of SHA256.

Usage

yarn add @chainsafe/as-sha256

import {digest, digest64, SHA256} from "@chainsafe/as-sha256";

let hash: Uint8Array;

// create a new sha256 context
const sha256 = new SHA256();
// with init(), update(data), and final()
hash = sha256.init().update(Buffer.from("Hello world")).final();

// or use a one-pass interface
hash = digest(Buffer.from("Hello world"));

// or use a faster one-pass interface for hashing (only) 64 bytes
hash = digest64(Buffer.from("abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh"));

License

Apache 2.0

FAQs

Package last updated on 30 May 2025

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