Switch from noble-secp256k1 to noble-curves

This commit is contained in:
Paul Miller
2023-04-14 16:26:33 +00:00
committed by fiatjaf_
parent f17ab41d72
commit 204ae0eff1
10 changed files with 648 additions and 804 deletions

View File

@@ -1,8 +1,8 @@
import * as secp256k1 from '@noble/secp256k1'
import {hexToBytes} from '@noble/hashes/utils'
/** Get POW difficulty from a Nostr hex ID. */
export function getPow(id: string): number {
return getLeadingZeroBits(secp256k1.utils.hexToBytes(id))
return getLeadingZeroBits(hexToBytes(id))
}
/**