Code Monkey home page Code Monkey logo

Comments (13)

rurban avatar rurban commented on May 20, 2024

Thanks, looks good

from smhasher.

rurban avatar rurban commented on May 20, 2024

Merged, thanks. I just had no room for your README.md docs. Maybe put them into the header.

from smhasher.

erthink avatar erthink commented on May 20, 2024

Sorry, but I just updated t1ha.
This is a fairly important change.

In general, I was switched to little bit faster 'mux' version (with 64x64 mul) and to C from C++.
But also fixes a possibility of crossing page boundary at the end of key, in case it was unaligned.
This is not a flaw in case using t1ha in the 1Hippeus project, but seriously bug for general hash function.

Please merge again.

from smhasher.

rurban avatar rurban commented on May 20, 2024

Can you add the t1ha_mux variant also?
This is now missing from your smhasher-rurban.t1ha branch

from smhasher.

erthink avatar erthink commented on May 20, 2024

It was decided to leave only the "mux" variant, at the same time renaming it into "t1ha".
Maybe it's not the best solution, but in general should be better.

I think, I should clarify:

  • The 'mux' version (which now called as main "t1ha") is faster for small keys, but same speed for large keys.
  • The old version (originally called 1Hippeus Hash) was dropped, because it should be fixed/refined against flaw that I noted.
  • This should not be mislead about "t1ha" name, because it just published as "Positive Hash" and it have not been used before.

https://github.com/leo-yuriev/t1ha/blob/smhasher-rurban.t1ha/main.cpp#L184

from smhasher.

rurban avatar rurban commented on May 20, 2024

But this would not work on 32bit then. No plan for a 32bit version?

from smhasher.

erthink avatar erthink commented on May 20, 2024

It should already work. More over, much faster than mum-hash.

I implemented the required multiplication for the absence of __int128.

https://github.com/leo-yuriev/t1ha/blob/smhasher-rurban.t1ha/t1ha.c#L149

from smhasher.

rurban avatar rurban commented on May 20, 2024

Great, updating and testing it now

from smhasher.

rurban avatar rurban commented on May 20, 2024

This looks like a bug:

add_with_carry(uint64_t *sum, uint64_t addend) {
  *sum += addend;
  return sum < addend;
}

=>
return *sum < addend;

and it is also invalid C++ with -fpermissive

from smhasher.

erthink avatar erthink commented on May 20, 2024

Oops. Sure this is bug. Just lost de-referense while conversion from C++ to C.

It is question for QA. How it passes the tests?

from smhasher.

rurban avatar rurban commented on May 20, 2024

I was QA. I didn't pass :)

in smhasher it just added randomly a 0 or 1 to it, which apparently qualifies as good enough.

on 32bit some constants are also too long and are capped. e.g. 2166136261 would need a 2166136261L there. but this is in a different function.

from smhasher.

erthink avatar erthink commented on May 20, 2024

;)

+1

I am on the road approximately two hours.

from smhasher.

erthink avatar erthink commented on May 20, 2024

Thank!

from smhasher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.