nip13: crazier and more fun and hopefully slightly more performant nonce encoding.

This commit is contained in:
fiatjaf
2024-08-20 13:54:51 -03:00
parent 437cdecfb1
commit edbbd6df44
3 changed files with 28 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ func Generate(event *nostr.Event, targetDifficulty int, timeout time.Duration) (
start := time.Now()
for {
nonce++
tag[1] = strconv.FormatUint(nonce, 10)
tag[1] = uintToStringCrazy(nonce)
if Difficulty(event.GetID()) >= targetDifficulty {
return event, nil
}