Sha256
🔑 SHA-256 Hashing for JavaScript
Install / Use
/learn @shahradelahi/Sha256README
@se-oss/sha256
@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
<details>
<summary>Install using your favorite package manager</summary>
pnpm
pnpm install @se-oss/sha256
yarn
yarn add @se-oss/sha256
</details>
📖 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.
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
