https://github.com/zcloak-network/rescue-hash
https://github.com/zcloak-network/rescue-hash
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zcloak-network/rescue-hash
- Owner: zCloak-Network
- Created: 2022-05-31T09:15:40.000Z (almost 3 years ago)
- Default Branch: dev
- Last Pushed: 2023-04-28T08:41:50.000Z (about 2 years ago)
- Last Synced: 2025-05-05T20:13:16.069Z (24 days ago)
- Language: Rust
- Size: 132 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rescue-hash
This is a wasm version of rescue-hash.## 1. What this can do?
1. It can do standardized rescue hash for 2 data. Such as Hash(A,B) => C (A,B and C shoud be `[u64;4]`, each data should contain 4 `u64` elements).
2. It can do rescue hash consecutively, in other word, it can Hash(A,B,C,D,....) => Hash(A,(B,(C,D)...)) Each data should contain 4 `u64` elements as well).
## 2. Input and Outputs
The `inputs` specifies the rescue input, it should contain 8 elements or more(over 8 but should be some multiple of 4);The `outputs` is the rescue result, which contains 4 elements as `Vec`.
## 3. How to use it ?
### a. For local test
Run the following commands:```bash
wasm-pack build --target web
``````bash
python -m http.server 8008
```And then you could see the hash result through your browser at `http://localhost:8008/`
### b. For Js
Run the following commands:```bash
wasm-pack build --target nodejs
```Move the pkg file to the workspace and run:
```bash
npm install ./pkg
```and then you can use this rescue as a module.