An open API service indexing awesome lists of open source software.

https://github.com/li0ard/bash

Bash (STB 34.101.77) hash function in pure TypeScript
https://github.com/li0ard/bash

bash crypto stb stb3410177

Last synced: 5 months ago
JSON representation

Bash (STB 34.101.77) hash function in pure TypeScript

Awesome Lists containing this project

README

          


@li0ard/bash

Bash (STB 34.101.77) hash function in pure TypeScript


docs












## Installation

```bash
# from NPM
npm i @li0ard/bash

# from JSR
bunx jsr i @li0ard/bash
```

## Supported modes
- [x] BASH.HASH128 (256 bit)
- [x] BASH.HASH192 (384 bit)
- [x] BASH.HASH256 (512 bit)
- [x] Programmable automatons (bash-prg)

## Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with [STB 34.101.77-2020 (in Russian)](https://apmi.bsu.by/assets/files/std/bash-spec24.pdf) standard
- Supports Bun, Node.js, Deno, Browsers

## Examples

```ts
import { Bash } from "@li0ard/bash"

let hash = new Bash(32)
hash.update(new TextEncoder().encode("hello world"))
console.log(hash.digest())

// -- OR --

import { bash256 } from "@li0ard/bash"

console.log(bash256(new TextEncoder().encode("hello world")))
```