This repository contains a simple implementation of SHA-256, created for learning purposes only.
To view the answers for the tasks from the assignment sheet, run:
go run main.goAlternatively, you can check the hash_test.go file, which also contains tests related to the exercises.
To compute a SHA-256 hash for a custom message, run:
go run cmd/main.go hash <your-message>| Argument | Description |
|---|---|
<your-message> |
Message to be hashed. Example: "hello world" |
This will print logs to help you follow and understand the process.
You can also try a weaker version of the SHA-256 function with additional parameters:
go run cmd/main.go hash <your-message> <iterations> false| Argument | Description |
|---|---|
<your-message> |
Message to be hashed. Example: "hello world" |
<iterations> |
Number of loops (iterations) – defines how many times the hashing process is repeated. |
false |
Uses a weaker version of the hash function – useful for experimentation and learning. |
This allows you to experiment with reduced hashing strength for learning purposes.
.
├── cmd/ # Contains the CLI entrypoint (main command logic)
│ └── main.go
├── main.go # Basic runner for exercises
├── hash_test.go # Tests for the SHA-256 implementation and exercises
├── core/... # The Logic of the code
└── README.md # Project documentation