Giter Site home page Giter Site logo

Comments (4)

KodrAus avatar KodrAus commented on June 26, 2024 1

Just coming back through some triage. It looks like as nice as this would be a to do, we probably can't in a non-breaking way, so I'll go ahead and close this one for now. We might be able to revisit it in the future if things change.

from uuid.

KodrAus avatar KodrAus commented on June 26, 2024

Hi @azdle 👋 This is a great suggestion 👍 I'd consider loosening that bound to be a minor change (the old API evolution RFC thinks so too). You're right that inference would break, like in this example:

let uuid = Uuid::new_v5(ns, name.as_ref());

but I think that's ok. These aren't really widely used methods and the proposed signature is better.

from uuid.

KodrAus avatar KodrAus commented on June 26, 2024

The ideal signature would probably simply be:

fn new_v5(namespace: &Uuid, name: impl Hash) -> Uuid

from uuid.

KodrAus avatar KodrAus commented on June 26, 2024

I looked into this, and it's unfortunately not as straight-forward as you'd hope. The standard hash APIs aren't really compatible with md5 or sha1, and when wrapped the hashing of slices produces different results than it previously did.

I think the best approach for now will be to add some examples to the project that show how you can convert something that implements Hash into a slice to pass to new_v5.

from uuid.

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.