Skip to content

pallad-ts/hasher

Repository files navigation

Hasher 🌄

Simple crypto async hashing api


CircleCI npm version Coverage Status License: MIT

Simple crypto async hashing api with nice TextBufferView API

SHA

Supports sha256, sha384, sha512 algorithms.

import { ShaHasher } from '@pallad/hasher';


const hasher = new ShaHasher(256); // or 384, 512

const hash = await hasher.hash(
	TextBufferView.fromString('Hello, world!', 'utf8')
);

hash.toString('hex'); // 315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3

Injectability

Since Hasher is an abstract class, you can make hasher injectable.

import {Hasher} from '@pallad/hasher';
class SomeService {
	constructor(private hasher: Hasher) {}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published