structhash
structhash copied to clipboard
Go (golang) package to get hash strings of arbitrary data structures.
golang 1.19 goarch: amd64 pkg: structhash cpu: AMD Ryzen 7 1700 Eight-Core Processor BenchmarkSimpleJSON-16 1894560 628.8 ns/op BenchmarkSimpleDump-16 499706 2418 ns/op BenchmarkFullJSON-16 299988 3937 ns/op BenchmarkFullDump-16 79993 14874 ns/op BenchmarkTagsJSON-16...
Go doesn’t have a native set type. That means developers have to use either an array type or a map type. In both cases, there is high potential for a...
Also, can we make sha256 the default Hash too? (i can do this in a separate pr)
test if "hash/fnv" is faster than md5 / sha, and possibly implement it.
Currently the hash only includes the fields of a struct and not the name of the struct type. This causes potentially unwanted hash collisions as seen below: ```go type TypeA...
It seems a special case was missed. Fixing this properly would break existing implementations. I need to think of a way to catch this, and not break backwards compatibility.