/** Get POW difficulty from a Nostr hex ID. */ export function getPow(hex: string): number { let count = 0 for (let i = 0; i < hex.length; i++) { const nibble = parseInt(hex[i], 16) if (nibble === 0) { count += 4 } else { count += Math.clz32(nibble) - 28 break } } return count }