A definitely insecure hashing function
2025-08-03 19:36:59 +02:00
.commitlintrc.mjs chore: initial commit 2025-08-03 11:23:32 +02:00
.dprint.jsonc chore: initial commit 2025-08-03 11:23:32 +02:00
.pre-commit-config.yaml chore: initial commit 2025-08-03 11:23:32 +02:00
CONTRIBUTING.md chore: initial commit 2025-08-03 11:23:32 +02:00
go.mod feat: create har command line 2025-08-03 19:26:14 +02:00
LICENSE.md chore: initial commit 2025-08-03 11:23:32 +02:00
main.go feat: release v1.0.0 2025-08-03 19:36:59 +02:00
README.md feat: release v1.0.0 2025-08-03 19:36:59 +02:00

har

v1.0.0

Har is a hashing algorithm (that is not cryptographically secure, nor mature) that creates an 8 char hash of any file/text you give to it..

It can be used to check if files are the same or arent corrupted.

In terms of speed it isn't the fastest, but the algorithm itself is pretty simple..

How does it work?

  1. Every input (text, image, etc...) is converted into an array of bytes.
  2. Each array of bytes are divided into 1024 bytes blocks, if we can't convert it into a 1024 byte block because it is too small, we add padding to the end of it. (1 after the data, and at the end oof it we write the length of the block)ck)
  3. We loop through each block and add each byte to an internal hash that is smaller then it..
  4. We return that internal hash while converting it into a base64 encoded string..

Pretty badly explained I know, however the code is pretty simple (really!) and you can check it out in main.go.

How to use

Simply install har through go (go install codeberg.org/virtualfuzz/har@latest)

Then, run har and write your text you want to hash, then press CTRL+D once you are done, your hash will then be printed!!

You can also pipe a file or text into it and it will print the hash!

> t; echo -n "ilmfc best game ever" | har
Hash:  vgjJOV33Y0I=

License

har is licensed under the AGPL-3.0-or-later.

Copyright (C) 2025 @virtualfuzz

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.on.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.s.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.