UNPKG
@ethersproject/hash
Version:
beta (6.0.0-beta.7)
latest (5.8.0)
6.0.0-beta.7
6.0.0-beta.6
6.0.0-beta.5
6.0.0-beta.4
6.0.0-beta.3
6.0.0-beta.2
6.0.0-beta.1
5.8.0
5.7.0
5.6.1
5.6.0
5.5.0
5.4.0
5.3.0
5.2.0
5.1.0
5.0.12
5.0.11
5.0.10
5.0.9
5.0.8
5.0.7
5.0.6
5.0.5
5.0.4
5.0.3
5.0.2
5.0.1
5.0.0
5.0.0-beta.134
5.0.0-beta.133
5.0.0-beta.132
5.0.0-beta.131
5.0.0-beta.130
5.0.0-beta.129
5.0.0-beta.128
5.0.0-beta.127
5.0.0-beta.126
5.0.0-beta.125
5.0.0-beta.124
5.0.0-beta.123
5.0.0-beta.122
5.0.0-beta.121
5.0.0-beta.120
5.0.0-beta.119
5.0.0-beta.118
5.0.0-beta.117
Hash utility functions for Ethereum.
github.com/ethers-io/ethers.js
ethers-io/ethers.js
@ethersproject/hash
/
src.ts
/
id.ts
7 lines
(5 loc)
•
195 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
{ keccak256 }
from
"@ethersproject/keccak256"
;
import
{ toUtf8Bytes }
from
"@ethersproject/strings"
;
export
function
id
(
text
:
string
):
string
{
return
keccak256
(
toUtf8Bytes
(text)); }