Giter VIP home page Giter VIP logo

Comments (4)

newpavlov avatar newpavlov commented on May 30, 2024

In your case it's better to use Digest trait from the digest crate, as I don't think you want to pull the whole rust-crypto as your dependency just for one trait. Also look into digest-buffer too, you may find it convenient.

One thing to note: Digest trait probably will change a bit in the future (see #14), I will publish the new version under 0.5, but I think it's better for you to know about it.

Any chance that your hash implementation could become part of this project in the future?

UPD: Ah, you want to write Dropbox Content Hasher if I am not mistaken and add Rust example to dropbox-api-content-hasher. Am I right?

from hashes.

cakoose avatar cakoose commented on May 30, 2024

Yup, it's a non-standard hash just for the Dropbox API, so probably not worth including in this project :-)

I'll go ahead and use the digest crate's trait for now. Thanks!

from hashes.

newpavlov avatar newpavlov commented on May 30, 2024

BTW you can write and publish crate dropbox-content-hasher (or with similiar name) and use it in your example instead of publishing source codes with implementation of this hash, I think it will be more convenient for potential users. Also note that generic-array (return type in the Digest trait) implements LowerHex and UpperHex, so you can simplify conversion to hex by using standard formatting functionality.

from hashes.

cakoose avatar cakoose commented on May 30, 2024

The goal is to actually have this code as part of the Dropbox API SDKs. It's just that those aren't ready yet, so we decided to publish code samples for early adopters to copy/paste for now.

Thanks for the hex tip. I'll update the code.

from hashes.

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.