]> git.maquefel.me Git - brevno-suite/hugo/commit
Add hash.XxHash
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 3 Jul 2024 09:20:46 +0000 (11:20 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 6 Jul 2024 12:08:15 +0000 (14:08 +0200)
commit644d55475d631f60177eb792e9a010a39160df85
tree327f2322d52e628a07f0d0690b3ce12f3f68709f
parentedeed52fc5d7c9c25fee53e0b66c155e248cf09d
Add hash.XxHash

Also move the non crypto hash funcs into this new package.

This is much faster than e.g. MD5, especially for larger inputs:

```
BenchmarkXxHash/xxHash_43-10           9917955        112.2 ns/op       56 B/op        4 allocs/op
BenchmarkXxHash/mdb5_43-10             6017239        204.1 ns/op       96 B/op        3 allocs/op
BenchmarkXxHash/fnv32a_43-10          14407333         82.30 ns/op       16 B/op        1 allocs/op
BenchmarkXxHash/xxHash_4300-10         2916892        409.7 ns/op       56 B/op        4 allocs/op
BenchmarkXxHash/mdb5_4300-10            159748       7491 ns/op     4912 B/op        3 allocs/op
BenchmarkXxHash/fnv32a_4300-10          218210       5510 ns/op       16 B/op        1 allocs/op
```

Fixes #12635
go.mod
go.sum
tpl/crypto/crypto.go
tpl/crypto/init.go
tpl/hash/hash.go [new file with mode: 0644]
tpl/hash/hash_test.go [new file with mode: 0644]
tpl/tplimpl/template_funcs.go