AWS SDK JS Crypto Helpers (SHA256 Browser)

Isomorphic SHA-256 hashing for the browser, preferring native WebCrypto with a pure-JS fallback for full compatibility.

Library
npm
v5.2.0
69 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
44 /100 Fair
Development Activity 40
Maintenance 16
Community 48
Maturity 60
Momentum 12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
66 /100 Good
Architecture 78
Code Quality 82
Innovation 45
Learning Curve 60

@aws-crypto/sha256-browser is the browser-targeted SHA-256 implementation from AWS’s aws-sdk-js-crypto-helpers monorepo, the small collection of cryptographic primitive packages (@aws-crypto/*) that AWS SDK for JavaScript v3 uses internally for request signing (SigV4) and payload integrity checksums. Rather than hand-writing a hash routine, it exposes a single Sha256 class that checks for window.crypto.subtle support at construction time and transparently delegates to the native Web Crypto API when present, falling back to the pure-JavaScript implementation from the sibling @aws-crypto/sha256-js package when it isn’t — giving callers one consistent update/digest/reset interface regardless of runtime.

Because it backs the official AWS SDK’s signing and checksum paths, it’s built to the same reliability bar: typed against a shared Checksum interface, unit-tested with mocha/chai/sinon against stubbed WebCrypto calls, and published under Apache-2.0 alongside its sibling sha256-js, sha256-universal, and supports-web-crypto packages.

What You Get

  • A single Sha256 class implementing update(), digest(), and reset() against a shared Checksum interface
  • Automatic runtime feature detection via @aws-crypto/supports-web-crypto, with zero configuration needed
  • A pure-JS fallback (@aws-crypto/sha256-js) for environments without window.crypto.subtle
  • Both plain hashing and HMAC-with-secret modes through the same constructor signature
  • Dual CJS/ESM builds (build/main, build/module) with TypeScript type declarations

Common Use Cases

  • Computing SigV4 request-signing hashes inside AWS SDK for JavaScript v3 clients running in the browser
  • Verifying S3 payload/content integrity checksums client-side before or after upload
  • Hashing user input or file contents in a web app without shipping a heavier general-purpose crypto library
  • Generating HMAC digests for lightweight browser-side request authentication

Under The Hood

Architecture The package is part of a lerna/npm-workspaces monorepo that exposes a single class, Sha256 (packages/sha256-browser/src/crossPlatformSha256.ts), implementing a shared Checksum interface (update, digest, reset). At construction it calls supportsWebCrypto(locateWindow()) to decide whether to delegate to WebCryptoSha256 (using crypto.subtle.digest/sign/importKey) or fall back to the pure-JS Sha256 from the sibling sha256-js package. It’s a clean strategy/adapter pattern: one thin dispatcher class picks between two interchangeable backends at runtime, both satisfying the same contract, with buffer conversion centralized in a shared util package. Because AWS SDK v3’s signing and checksum code across many clients depends on this exact interface, it functions as a load-bearing shared abstraction rather than a private implementation detail.

Tech Stack Written in TypeScript and compiled twice (tsc) to CJS and ESM outputs with dual package.json exports, managed inside an npm-workspaces plus Lerna monorepo. Sibling workspace dependencies are linked via the file: protocol during development, with pinned semver ranges for external AWS SDK type and utility packages. There’s no runtime framework — it’s a leaf utility package. Testing uses mocha, chai, sinon, and ts-node; releases run through both GitHub Actions and internal AWS CodeBuild pipelines, with a local Verdaccio registry used to dry-run publishes.

Code Quality Tests exist and are meaningful, stubbing crypto.subtle and asserting exact call arguments for both plain digests and HMAC key imports. Error handling is deliberate but minimal — an explicit catch on the key-import promise avoids unhandled-rejection noise while still surfacing errors through the real digest() call. Types are used consistently via shared interfaces, and the test suite itself is type-checked before running. Prettier plus husky/lint-staged enforce formatting on commit, and CI runs on both GitHub Actions and CodeBuild.

What Makes It Unique SHA-256 itself is a standard, well-known algorithm, so the genuinely useful technical choice here is the “prefer native WebCrypto, fall back to pure JS” dispatch hidden behind one stable class name — letting the rest of the AWS SDK v3 ecosystem call a single consistent async hashing API without every caller needing to feature-detect window.crypto.subtle itself. The public API is minimal and requires almost no boilerplate to adopt, though it isn’t something an experienced developer couldn’t reasonably build from scratch.

Used by 11 apps in this directory

TypeScript
100%
Other

Activepieces

AI Assistants · Automation · Mcp

24,756

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript 100%
Updated 5 days ago
TypeScript
91%
Apache 2.0

Helicone

AI Development · Analytics · Monitoring

6,182

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
70
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 91%
Updated 2 weeks ago
TypeScript
99%
MIT

GraphQL Hive

Developer Tools · Devops · Monitoring

484

Open-source GraphQL schema registry and observability platform with breaking change detection, federation support, and CI/CD integration for teams of any size.

View details
90
Repo Health
81
Technical
69
Dependency
Built with
TypeScript 99%
Updated 5 days ago
Rust
52%
Other

hoodik

File Storage · Security

1,484

Self-hosted, end-to-end encrypted cloud storage with browser-based encryption and S3-compatible storage support

View details
79
Repo Health
71
Technical
63
Dependency
Built with
Rust 52%
TypeScript 33%
Vue 14%
Updated 1 weeks ago
TypeScript
97%
Other

Langfuse

AI Development · Monitoring

35,117

Open source AI engineering platform for LLM observability, prompt management, evaluation, and debugging — self-host in minutes or use Langfuse Cloud.

View details
92
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 97%
Updated 5 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

206,147

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 92%
Updated 5 days ago
TypeScript
51%
ZLIB

Portainer

Devops

38,590

A lightweight, open-source web UI that puts Docker, Kubernetes, and Podman management within reach of any team—no CLI expertise required.

View details
92
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 51%
Go 38%
Updated 1 weeks ago
TypeScript
95%
MIT

qm

AI Agents · AI Assistants · Automation

15,266

An open-source, multiplayer agent harness that gives every employee and every room in a company its own scoped memory, sandbox, and AI agent — in Slack and on the web.

View details
80
Repo Health
88
Technical
84
Dependency
Built with
TypeScript 95%
Updated 6 days ago
JavaScript
57%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,007

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
JavaScript 57%
TypeScript 36%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers