Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Benchstat Geomean Results1.14% sec/op, -0.00% B/op, 0.00% allocs/op Benchstat results |
nickzelei
left a comment
There was a problem hiding this comment.
LGTM, left a comment regarding supported types.
| return v, nil | ||
| case []byte: | ||
| return string(v), nil | ||
| // todo: handle more types |
There was a problem hiding this comment.
Would it be difficult to fill in more types here? Ideally this thing works for any type and we can allow it for any or most data types. Unclear how this will appear on the FE atm though.
There was a problem hiding this comment.
I'm moreso wondering fi there is a way to effectively cast any input type to either []byte or string. Whichever is the most convenient for passing in to a hash function. You can hash anything if it's a []byte...maybe casting to string is not the best approach.
| } | ||
|
|
||
| func hashToString(hasher hash.Hash, input string) (string, error) { | ||
| _, err := hasher.Write([]byte(input)) |
There was a problem hiding this comment.
maybe it's better to make the input a []byte then we just convert the value any to a []bte, then we support everything.
No description provided.