From 02da1dc03688263501493442c1284a2cca0d8c4f Mon Sep 17 00:00:00 2001 From: abhay-raizada Date: Sat, 23 Mar 2024 18:00:23 +0530 Subject: [PATCH] Readme: Instructions to convert sk to hex --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 07d47d9..d5a91a7 100644 --- a/README.md +++ b/README.md @@ -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