har

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

README

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)
  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!

> 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.

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.

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/.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL