Readme: Instructions to convert sk to hex
This commit is contained in:
parent
7aed747bb2
commit
02da1dc036
|
@ -25,6 +25,15 @@ let sk = generateSecretKey() // `sk` is a Uint8Array
|
|||
let pk = getPublicKey(sk) // `pk` is a hex string
|
||||
```
|
||||
|
||||
To get the secret key in hex format, use
|
||||
|
||||
```js
|
||||
import { bytestohex, hexToBytes } from '@noble/hashes/utils' // already an installed dependency
|
||||
|
||||
let skHex = bytestohex(sk)
|
||||
let backToBytes = hexToBytes(skHex)
|
||||
```
|
||||
|
||||
### Creating, signing and verifying events
|
||||
|
||||
```js
|
||||
|
|
Loading…
Reference in New Issue