Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coins/sha256
JavaScript implementation of SHA256 extracted from Bitcoin Core and compiled to WebAssembly
https://github.com/coins/sha256
Last synced: 6 days ago
JSON representation
JavaScript implementation of SHA256 extracted from Bitcoin Core and compiled to WebAssembly
- Host: GitHub
- URL: https://github.com/coins/sha256
- Owner: coins
- Created: 2023-11-30T20:14:26.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-03T22:22:03.000Z (9 months ago)
- Last Synced: 2024-11-01T11:02:30.458Z (13 days ago)
- Language: C++
- Homepage:
- Size: 30.3 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-bitvm - SHA256 WASM
README
# SHA256 WASM
SHA256 implementation extracted from [Bitcoin Core](https://github.com/bitcoin/bitcoin/blob/master/src/crypto/sha256.cpp) and compiled to WebAssembly.
## Usage
```js
import {sha256} from 'https://bitvm.github.io/sha256/sha256.js'const preimage = new Uint8Array([97, 98, 99]) // Our preimage is "abc"
const digest = sha256(preimage)console.log(digest)
```## Development
The following command compiles the sources to wasm:
```sh
clang src/sha256.cpp -O2 --no-standard-libraries --target=wasm32 -Wl,--no-entry -o sha256.wasm
```