hashstructure icon indicating copy to clipboard operation
hashstructure copied to clipboard

Get hash values for arbitrary values in Go (golang).

Results 14 hashstructure issues
Sort by recently updated
recently updated
newest added

Hi, I had found an issue that self-reference or cyclic-reference will lead to stack overflow. Here is an example: ```golang package main import "github.com/mitchellh/hashstructure/v2" type Node struct { Ptr *Node...

I just ran into this issue, took some time to figure out. ``` type t struct { A *int } var zero int fmt.Println(hashstructure.Hash(t{}, hashstructure.FormatV2, nil)) fmt.Println(hashstructure.Hash(t{A: &zero}, hashstructure.FormatV2, nil))...

I encountered an error with `syscall.Errno` (defined as `uintptr`): ```go var err syscall.Errno _, herr := hashstructure.Hash(err, hashstructure.FormatV2, nil) ``` ```text binary.Write: invalid type syscall.Errno ``` I could test for...

Add `IgnoreTimeLocation` option; when set the hash of a `time.Time` value is stable regardless of the location it is displayed in. This is useful when timestamps are serialized using `msgpack`...

If two slices differ only by an item that is repeated in both, it's trivial to construct hash collisions. ``` package main import ( "fmt" hashstructure "github.com/mitchellh/hashstructure/v2" ) func main()...

**motivation** hashstructure has a slightly sharp edge in that if a struct contains only unexported fields, that it will hash to the same identity. This is undesirable because many structs...

Without this functionality, we have to add a map into a struct in order to filter out some keys from hashing.

This introduces an option, `UseBinary`, which will use the `encoding.MarshalBinary` interface of any type implementing it. This fixes hashes of time value for one thing, and expands on the time.Time...

Apply IgnoreZeroValue also if UseStringer is set to make it consistent and allow to ignore empty stringer values.

Like Git has 7, what is the recommendation here?