Comments (1)
Compiling your program and testing it, I get:
$ ./main
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Creating a file with the same contents to compare with sha256sum, I get:
$ echo -n abc > tmp.txt
$ sha256sum tmp.txt
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad tmp.txt
Looks consistent to me. You must be making a mistake somewhere, like having a line feed in your text file.
For the record, you do not need to redefine HASH_LENGTH
. You can just use SIZE_OF_SHA_256_HASH
instead.
from sha-2.
Related Issues (11)
- Problem with format string HOT 3
- Dual license the project with Original + public-domain equivalent license HOT 1
- Does this work on files? HOT 1
- Is sha-2 thread safe ? HOT 1
- Why SIZE_OF_SHA_256_HASH macro is not referenced in sha-256.c ? HOT 2
- Large messages unusable (too big for stack allocation) HOT 10
- Possible memory optimization HOT 2
- Memory leak? valgrind is not happy. HOT 1
- Why include the .h in the repo? HOT 2
- Add a streaming API for computing SHA-256. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sha-2.