-
Notifications
You must be signed in to change notification settings - Fork 153
NEOS-1714 add hash transformer #3477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.