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

@aws-sdk/hash-blob-browser

Package Overview
Dependencies
Maintainers
5
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/hash-blob-browser

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/hash-blob-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/hash-blob-browser) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/hash-blob-browser.svg)](https://www.npmjs.com/package/@

  • 3.374.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

What is @aws-sdk/hash-blob-browser?

@aws-sdk/hash-blob-browser is a package from the AWS SDK for JavaScript that provides utilities for computing cryptographic hashes of Blob objects in a browser environment. This is particularly useful for tasks such as data integrity checks, digital signatures, and other cryptographic operations.

What are @aws-sdk/hash-blob-browser's main functionalities?

Compute SHA-256 Hash

This feature allows you to compute the SHA-256 hash of a Blob object. The code sample demonstrates how to create a new Sha256 instance, update it with the Blob data, and then compute the digest.

const { Sha256 } = require('@aws-sdk/hash-blob-browser');

async function computeSHA256(blob) {
  const hash = new Sha256();
  hash.update(blob);
  const digest = await hash.digest();
  return digest;
}

// Usage example
const blob = new Blob(['Hello, world!']);
computeSHA256(blob).then(digest => console.log(digest));

Compute MD5 Hash

This feature allows you to compute the MD5 hash of a Blob object. The code sample demonstrates how to create a new Md5 instance, update it with the Blob data, and then compute the digest.

const { Md5 } = require('@aws-sdk/hash-blob-browser');

async function computeMD5(blob) {
  const hash = new Md5();
  hash.update(blob);
  const digest = await hash.digest();
  return digest;
}

// Usage example
const blob = new Blob(['Hello, world!']);
computeMD5(blob).then(digest => console.log(digest));

Other packages similar to @aws-sdk/hash-blob-browser

FAQs

Package last updated on 20 Jul 2023

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