Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@se-oss/sha256

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@se-oss/sha256

Lightweight JavaScript utilities for SHA-256 and HMAC-SHA-256 hashing, compatible with any JS runtime.

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

@se-oss/sha256

CI NPM Version MIT License npm bundle size Install Size Edge Runtime Compatible

@se-oss/sha256 is a JavaScript library that provides utilities for SHA-256 and HMAC-SHA-256 hashing. This library is designed to work seamlessly in any JavaScript runtime, offering efficient and straightforward functions for cryptographic hashing.

📦 Installation

npm i @se-oss/sha256
Install using your favorite package manager

pnpm

pnpm install @se-oss/sha256

yarn

yarn add @se-oss/sha256

📖 Usage

Hashing

import { sha256 } from '@se-oss/sha256';

// Hashing a string
const hash = sha256('Hello, world!');

// Hashing a Uint8Array
const data = new Uint8Array([1, 2, 3, 4, 5]);
const hash2 = sha256(data);

HMAC

import { hmacSha256 } from '@se-oss/sha256';

const key = 'my-secret-key';
const message = 'Hello, HMAC!';
const hmac = hmacSha256(key, message);

Streaming

import { createSha256 } from '@se-oss/sha256';

const hasher = createSha256();
hasher.update('Hello, ');
hasher.update('world!');

const hexHash = hasher.digest('hex');

Timing Safe Comparison

import { timeSafeCompare } from '@se-oss/sha256';

const result = timeSafeCompare('hello', 'hello'); // true

📚 Documentation

For detailed API documentation on all methods, please see the API docs.

🤝 Contributing

Want to contribute? Awesome! To show your support is to star the project, or to raise issues on GitHub.

Thanks again for your support, it is much appreciated! 🙏

🙌 Credits

License

MIT © Shahrad Elahi and contributors.

Keywords

hashing

FAQs

Package last updated on 23 Dec 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