-
Notifications
You must be signed in to change notification settings - Fork 105
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
compute_hash_on_elements
could accept any iterator on FieldElement
#575
Comments
The issue with |
What we could do is maybe The only benefit of this change, as far as I know, is that you can now also pass in owned values, which could be useful in a threading scenario. Not that it's not useful in certain cases, but it's probably not what you're looking for. |
Oh the other hand, we can indeed provide a hasher type which would actually work better with iterators? Such a hasher would probably be rather generic and won't hash the arrary length at the end though. |
compute_hash_on_elements(my_slice.into_iter().cloned()) This ensures you own the value you are passing in. |
starknet-rs/starknet-core/src/crypto.rs
Line 49 in d980869
Right now the signature requires the input to be
&[FieldElement]
but it's implementation would still be valid if the input were to be a more genericT: Iter<FieldElement>
. It would allow more flexibility for the lib usersThe text was updated successfully, but these errors were encountered: