mirror of
https://github.com/emn178/js-sha3.git
synced 2026-08-12 19:41:36 +08:00
Support byte array and ArrayBuffer input.
This commit is contained in:
@@ -157,6 +157,20 @@ keccak_256('中文');
|
||||
keccak_224('中文');
|
||||
// f71837502ba8e10837bdd8d365adb85591895602fc552b48b7390abd
|
||||
```
|
||||
|
||||
It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` input:
|
||||
|
||||
Code
|
||||
```JavaScript
|
||||
sha3_512([]);
|
||||
// a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26
|
||||
|
||||
sha3_512(new Uint8Array([]));
|
||||
// a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26
|
||||
|
||||
// ...
|
||||
```
|
||||
|
||||
## Benchmark
|
||||
[UTF8](http://jsperf.com/sha3/5)
|
||||
[ASCII](http://jsperf.com/sha3/4)
|
||||
|
||||
Reference in New Issue
Block a user