9 Commits

Author SHA1 Message Date
reis
63919cf685
support wasm (#163) 2025-01-02 09:42:04 -03:00
fiatjaf
b58c4c5516 nip13: defer cancel() calls. 2024-10-18 07:08:47 -03:00
fiatjaf
f9271a6802 fix two tests. 2024-10-14 17:50:37 -03:00
fiatjaf
83bd196bae nip13: parallel DoWork(), deprecate Generate() 2024-08-20 23:04:52 -03:00
fiatjaf
2da58356b0 Revert "nip13: crazier and more fun and hopefully slightly more performant nonce encoding."
This reverts commit edbbd6df445dcd2bed8025397c44f2d03661f014.
2024-08-20 17:05:49 -03:00
fiatjaf
edbbd6df44 nip13: crazier and more fun and hopefully slightly more performant nonce encoding. 2024-08-20 13:54:51 -03:00
fiatjaf
437cdecfb1 nip13: CommittedDifficulty() 2024-08-20 13:19:21 -03:00
Isaque Veras
0f66883dc7 feat(kind): using constants 2023-09-07 07:05:01 -03:00
alex
5bfb398f4d nip13: check and generate proof of work
implementation as per NIP-13
https://github.com/nostr-protocol/nips/blob/e79c84ae/13.md

some benchmark results:

    $ go test -bench . ./nip13
    goos: linux
    goarch: amd64
    pkg: github.com/nbd-wtf/go-nostr/nip13
    cpu: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    BenchmarkCheck-8                        144905385                8.328 ns/op
    BenchmarkGenerateOneIteration-8           467874              2451 ns/op
    BenchmarkGenerate/8bits-8                   4045           1033196 ns/op
    BenchmarkGenerate/16bits-8                    16         101939954 ns/op
    BenchmarkGenerate/24bits-8                     1        11411513764 ns/op
    PASS
    ok      github.com/nbd-wtf/go-nostr/nip13       22.220s
2022-12-26 08:05:40 -03:00