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
- Host: GitHub
- URL: https://github.com/li0ard/bash
- Owner: li0ard
- License: mit
- Created: 2025-09-09T16:51:50.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-09T16:57:17.000Z (9 months ago)
- Last Synced: 2025-09-11T14:54:07.455Z (9 months ago)
- Topics: bash, crypto, stb, stb3410177
- Language: TypeScript
- Homepage: https://li0ard.is-cool.dev/bash
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
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")))
```