🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@chainsafe/as-sha256

Package Overview
Dependencies
Maintainers
2
Versions
24
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

latest
Source
npmnpm
Version
1.2.4
Version published
Weekly downloads
153K
-8.27%
Maintainers
2
Weekly downloads
 
Created
Source

as-sha256

ES Version Node Version

AssemblyScript implementation of SHA256.

Usage

pnpm 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 21 Apr 2026

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