1. @aws-crypto/sha256-js
A pure JS implementation SHA256.
@aws-crypto/sha256-js
Package: @aws-crypto/sha256-js
Created by: aws
Last modified: Mon, 16 Oct 2023 19:44:47 GMT
Version: 5.2.0
License: Apache-2.0
Downloads: 68,497,505
Repository: https://github.com/aws/aws-sdk-js-crypto-helpers

Install

npm install @aws-crypto/sha256-js
yarn add @aws-crypto/sha256-js

crypto-sha256-js

A pure JS implementation SHA256.

Usage

  • To hash "some data"
import {Sha256} from '@aws-crypto/sha256-js';

const hash = new Sha256();
hash.update('some data');
const result = await hash.digest();

  • To hmac "some data" with "a key"
import {Sha256} from '@aws-crypto/sha256-js';

const hash = new Sha256('a key');
hash.update('some data');
const result = await hash.digest();

Test

npm test

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code