Giter Site home page Giter Site logo

Comments (2)

jpountz avatar jpountz commented on May 25, 2024

That's an interesting question. When I wrote the API, I hesitated between going with an int or a long whose 32 lower bits would be used, but preferred the int version as it made very clear that this hash function only works on 32 bits.

I would like to have more opinions on this one, if there seems to be consensus around moving to a long whose 32 lower bits would be used, I would be happy to change it.

Note to readers of this issue: You can turn the hash to an unsigned value by applying a mask, ie. StreamingXXHash32.getValue() & 0xFFFFFFFFL which will turn the integer value into an unsigned long.

from lz4-java.

 avatar commented on May 25, 2024

I think it depends on the supporting a 'realistic use-case' -- if what @meden describes is absolutely a valid and potentially common use-case, then the API should probably support without the need to resort to bit ops.

If it's more of an edge case and not how the API was meant to be used or not in the spirit of it, then probably just great javadoc to clarify the bit ops approach.

My 2 cents and my eternal belief in the 'path of least surprise' when it comes to API design :)

from lz4-java.

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.