-
Notifications
You must be signed in to change notification settings - Fork 13
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
Example does not work #45
Comments
Hi and thanks for your report and suggestions.
Agreed, at least until we find a better solution. I don't think using
I used ssh to initialize the submodules, using HTTPS would be more reliable here. I'm going to remove all the submodules in the next release (soon) anyway to make ntHash easier to install/use.
This was coincidentally suggested to me in-person very recently. One would have to modify the |
Hi, thanks for the quick responses to all my questions! I expected that you may want to avoid extra copying. Best |
this is still not working! It took me a while to realize that too :-) |
Hi,
this example does not work:
more precisely this is not working:
I get just one hash.
I'm not using cmake build, I just get all the sources needed and use
When I change to set the length it works:
Also this works:
but no this:
(the equivalent of the same as in the original example).
It took me a while to understand this.
Ctor captures const std::string& ref.
C++ guarantees that the temporal value (explicit like in the last code fragment, or implicit like in the original example) will live until the function end. The problem is the delegated ctor (const char*) does not copy the string content and we have a dangling pointer at the end.
Proposed solution:
maybe use memcpy like in the case of
BlindNtHash
?Although maybe there are reasons to not do this.
Anyway would be great to fix the example.
BTW. I had some issues cloning submodules, I have changed .gitmodules to
I'm not sure if it does make any difference.
BTW2.
Let's say I have a bit packet sequence, i.e. two bits per symbol in a form of uint64_t array.
Is there a way to use ntHash without unpacking it to std::string/cstring?
It's not crucial and may potentially be even worse vs efficient unpacking, but just out of curiosity.
The text was updated successfully, but these errors were encountered: