Git Product home page Git Product logo

Comments (6)

Dr-Emann avatar Dr-Emann commented on May 24, 2024

My personal preference would be as follows:

use octavo::digest::Sha1;
use octavo::digest::sha2::Sha512;
use octavo::digest::sha3::Sha256;

This fits my expectations as a user: I've never heard of the the SHA3 versions referred to as - e.g. sha3512. SHA1 is its own algorithm, whereas SHA2/3 are families of algorithms. And it's still easy to use both in the same program:

use octavo::digest::{sha2, sha3};
let digest1 = sha2::Sha512::default();
let digest2 = sha3::Sha512::default();

from octavo.

hauleth avatar hauleth commented on May 24, 2024

Me too, but as SHA-3 is fairly new I do not hear much about it. SHA-2 functions are commonly refereed as SHA-XXX not SHA2-XXX and only tool that support SHA-3 under that name (that I know) is rhash which refers to it as SHA3-XXX.

To make it more weird and complicated SHA-1 and SHA-2 was described in the same document FIPS 180-4 and SHA-2 hash family was refereed as SHA-XXX there, this make impression that SHA-1 and SHA-2 (namely SHA-XXX) are related and SHA-3 is whole new hash function family.

EDIT:

Also NIST on their page refers to SHA-2 family as SHA-XXX and to SHA-3 as SHA3-XXX

from octavo.

arthurprs avatar arthurprs commented on May 24, 2024

@Dr-Emann suggestion looks good to me, when in doubt naming should be obvious even if we need one more level for the namespace.

from octavo.

hauleth avatar hauleth commented on May 24, 2024

@arthurprs it also seems right to me, but I don't know if Sha1 should be reexported. It could be both, but I am still not sure.

from octavo.

hauleth avatar hauleth commented on May 24, 2024

This also leave us with whole MD family. It should be moved into one module named octavo::digest::md or should be left as is?

from octavo.

hauleth avatar hauleth commented on May 24, 2024

FIxed by #53

from octavo.

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.