11 Commits

Author SHA1 Message Date
Michael Muré
58ebd20b04 feat: rename Discriminant to Algorithm 2025-08-05 15:41:30 +02:00
Michael Muré
af0845c832 Remove support for varsig v0 2025-07-28 20:41:02 +02:00
Michael Muré
35ef54f79f feat: turns out, PayloadEncoding can be multiple values for EIP191 2025-07-24 16:52:58 +02:00
Michael Muré
0763d6f8b6 feat(hashes): shorten HashAlgorithm to Hash, add more of them 2025-07-22 12:03:56 +02:00
Michael Muré
5fb3516d15 feat(deps): remove the multicodec dependency, as varsig constants are not multicodec 2025-07-10 12:39:27 +02:00
Michael Muré
03770e0d38 use value receiver, remove unneeded generic 2025-07-09 13:39:09 +02:00
Michael Muré
5cea53af26 perf(constants): avoid allocating a map for each Decode*() call
```
goos: linux
goarch: amd64
pkg: github.com/ucan-wg/go-varsig
cpu: 13th Gen Intel(R) Core(TM) i7-1360P
                         │    old.txt    │               new.txt                │
                         │    sec/op     │    sec/op     vs base                │
DecodeHashAlgorithm-16     145.65n ± 10%   59.62n ± 30%  -59.07% (p=0.000 n=10)
DecodePayloadEncoding-16   136.65n ± 46%   50.02n ±  5%  -63.40% (p=0.000 n=10)
geomean                     141.1n         54.60n        -61.29%

                         │  old.txt   │               new.txt               │
                         │    B/op    │    B/op     vs base                 │
DecodeHashAlgorithm-16     48.00 ± 0%   48.00 ± 0%       ~ (p=1.000 n=10) ¹
DecodePayloadEncoding-16   48.00 ± 0%   48.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                    48.00        48.00       +0.00%
¹ all samples are equal

                         │  old.txt   │               new.txt               │
                         │ allocs/op  │ allocs/op   vs base                 │
DecodeHashAlgorithm-16     1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
DecodePayloadEncoding-16   1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                    1.000        1.000       +0.00%
¹ all samples are equal
```
2025-07-08 16:53:40 +02:00
Steve Moyer
caaa0204b8 fix(hash): HashAlgorithmUnspecified should not be ok 2025-07-08 09:42:09 -04:00
Steve Moyer
83227f36a7 docs: refine Go docs and improve naming 2025-07-08 07:34:57 -04:00
Steve Moyer
03bcfb7b16 feat(eddsa): add support for EdDSA varsigs - and common Ed25519 and Ed448 algorithms 2025-07-07 15:42:11 -04:00
Steve Moyer
9c83def9e0 feat(constant): add types/decoders for hash algorithms and payload encoding 2025-07-07 07:36:01 -04:00