Skip to content
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

expose sorted object #51

Open
bean5 opened this issue Oct 5, 2017 · 6 comments
Open

expose sorted object #51

bean5 opened this issue Oct 5, 2017 · 6 comments

Comments

@bean5
Copy link
Contributor

bean5 commented Oct 5, 2017

For auditing purposes, it would be helpful to have both the hash and the sorted object (e.g. the objects that would be hashed with setting of {unorderedArrays: true, unorderedSets: true}).

I would contribute this option myself, but I don't think I would get it right.

@addaleax
Copy link
Collaborator

addaleax commented Oct 8, 2017

@bean5 Can you explain a bit more how the API for this would look like, as you have it in mind? It sounds like you have a more concrete idea of it than I do…

@bean5
Copy link
Contributor Author

bean5 commented Oct 8, 2017

Just before hashing, but after sorting, return the sorted value. Do this as a subroutine by the hash functions. Exposing this as a function would allow this project to be used to sort deterministically. Does that make sense?

@addaleax
Copy link
Collaborator

addaleax commented Oct 9, 2017

@bean5 Sorry, but what do you mean by “return the sorted value before hashing”? That doesn’t quite make sense – after returning, a function doesn’t do anything anymore (by definition…)

Are you talking about a hook that transforms values in a certain way? Or splitting this library into serialization + hashing?

@bean5
Copy link
Contributor Author

bean5 commented Oct 9, 2017 via email

@addaleax
Copy link
Collaborator

So, you want a way to get the intermediate object that’s created after sorting?

@bean5
Copy link
Contributor Author

bean5 commented Oct 11, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants