These devlogs are getting quite boring, since basically every commit is just making the CLI more robust and more powerful. I’ve added a few features however, including verbose logging (which exposes more information about the process), the –format flag (which allows outputting in hex or base64 format), and MOAR algorithms! I’ve added the other sha2 algs, sha3, and blake algorithms.
Log in to leave a comment
I’ve spent some time refactoring and fixing up my code. These changes are primarily internal, but they should allow me to add more commands easily by shifting helper functions to their respective packages. I’ve also fixed up some of the broken output formatting, switched to Cobra’s internal libraries that integrate with their ecosystem, and I’ve added more comments.
Log in to leave a comment
I’ve done a lot of cleaning up of the mess I just created, but I’ve also added support for files (–file) and stdin (e.g. pipe). It does need a bit more polishing to make it robust, but it works half-decent for now. I’ve also added go tests—mostly for fun really, but useful to have in the future. And lastly a simple workflow to run these tests and build it on every push to Github.
feat: add go workflow
fix(hash): rename error to err
fix(hash): list algorithms with newline
chore: remove redundant debug logs
fix(root): remove template init
chore(root): add description to root
feat(cmd): add hash tests
fix(cmd): remove capitalised error
feat(cmd): detect empty input
chore(cmd): remove TODO
feat(cmd): support stdin
feat(cmd): support –file
fix(cmd): handle errors
feat(cmd): add –list
Log in to leave a comment
I couldn’t wait to get started, so I decided to start with a hashing algorithm, since it seemed like the easiest to implement. It took me a while, but everything went pretty smooth. I wish I had implemented a better skeleton though, as I currently only have a template for hashing functions, but nothing else. This might haunt me in the future… For now, I’ve added md5 and sha256 just as an example. I’ve also added the project description to the README file.
feat(cmd): add md5
feat(cmd): add hashing command
feat(cmd): add hashing algorithm
feat(cmd): add hash.go
docs(readme): add description
Log in to leave a comment
Setup done! I’ve only logged 11 minutes on hackatime, but I’ve been busy configuring the repository and brainstorming ideas for the project. Next up will be the initial configuration for Cobra (https://github.com/spf13/cobra) and developing the skeleton of the CLI to support future algorithms.
Log in to leave a comment