mirror of
https://github.com/emn178/js-sha3.git
synced 2026-08-12 19:41:36 +08:00
## v0.9.0 / 2023-08-30
### Fixed - cSHAKE bug. #24 - dependencies and security issues.
This commit is contained in:
@@ -84,26 +84,46 @@ var hash = cshake128.create(256, 'function name', 'customization');
|
||||
// specify kmac key, output bits and customization when creating
|
||||
var hash = kmac128.create('key', 256, 'customization');
|
||||
```
|
||||
### Node.js
|
||||
If you use node.js, you should require the module first:
|
||||
```JavaScript
|
||||
sha3_512 = require('js-sha3').sha3_512;
|
||||
sha3_384 = require('js-sha3').sha3_384;
|
||||
sha3_256 = require('js-sha3').sha3_256;
|
||||
sha3_224 = require('js-sha3').sha3_224;
|
||||
keccak512 = require('js-sha3').keccak512;
|
||||
keccak384 = require('js-sha3').keccak384;
|
||||
keccak256 = require('js-sha3').keccak256;
|
||||
keccak224 = require('js-sha3').keccak224;
|
||||
shake128 = require('js-sha3').shake128;
|
||||
shake256 = require('js-sha3').shake256;
|
||||
cshake128 = require('js-sha3').cshake128;
|
||||
cshake256 = require('js-sha3').cshake256;
|
||||
kmac128 = require('js-sha3').kmac128;
|
||||
kmac256 = require('js-sha3').kmac256;
|
||||
const {
|
||||
sha3_512,
|
||||
sha3_384,
|
||||
sha3_256,
|
||||
sha3_224,
|
||||
keccak512,
|
||||
keccak384,
|
||||
keccak256,
|
||||
keccak224,
|
||||
shake128,
|
||||
shake256,
|
||||
cshake128,
|
||||
cshake256,
|
||||
kmac128,
|
||||
kmac25
|
||||
} = require('js-sha3');
|
||||
```
|
||||
|
||||
### TypeScript
|
||||
If you use TypeScript, you can import like this:
|
||||
```TypeScript
|
||||
import { sha3_512 } from 'js-sha3';
|
||||
import {
|
||||
sha3_512,
|
||||
sha3_384,
|
||||
sha3_256,
|
||||
sha3_224,
|
||||
keccak512,
|
||||
keccak384,
|
||||
keccak256,
|
||||
keccak224,
|
||||
shake128,
|
||||
shake256,
|
||||
cshake128,
|
||||
cshake256,
|
||||
kmac128,
|
||||
kmac256
|
||||
} from 'js-sha3';
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
Reference in New Issue
Block a user