Giter Club home page Giter Club logo

Comments (4)

sijanec avatar sijanec commented on September 22, 2024 1

from crypto-algorithms.

sijanec avatar sijanec commented on September 22, 2024

So you're implying that SHA256 yields a 64 byte hash? As far as I know, the hash is indeed 32 bytes. From the name "SHA256" it's visible that the hash is 256 bits long and that unsigned chars are used as bytes (8 bits), we can calculate that the hash is 256/8 (32) bytes long.

Maybe you're referring to the size of bytes if the hash is converted to a hexadecimal string and as one hexadecimal character represents 4 bits but takes 8 bits of space, the resulting "block" would be two times larger. This implementation does not store hashes as hexadecimal strings.

from crypto-algorithms.

sgetzpeng avatar sgetzpeng commented on September 22, 2024

@sijanec
Thanks for your reply. However, According to the SHA standard, the output value size and the block size might be different. For example, according to https://en.wikipedia.org/wiki/Secure_Hash_Algorithms, SHA-224 and SHA-256's output size is 28 and 32 respectively, but both of the block size are 64 bytes(512-bit).
Any comments?

/Sgetz

from crypto-algorithms.

sgetzpeng avatar sgetzpeng commented on September 22, 2024

@sijanec
Never mind. The library is very good and I appreciate your release. Moreover, It would not confuse anyone if you replace SHA256_BLOCK_SIZE with SHA256_OUTPUT_SIZE.
Just my 2 cents.:smile:
/Sgetz

from crypto-algorithms.

Related Issues (17)

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.