Hash or checksum calculators

I’m looking for a hash or checksum calculator for linux - Fedora.
I currently use a Windows based app called SlavaSoft HashCalc: http://www.slavasoft.com/hashcalc/
But, I really want to dump all vestiges of Windows.
I prefer to not use online calculators.
Does anyone have a favorite they would recommend?

for something like sha256 all you would do is run this command

sha256sum foo.txt

2 Likes

Python, go, and most other languages standard libraries also include easy to use hash libraries if you want to build something that uses hashes in a specific way. (Could be a good starter coding project)

1 Like

I’ve read that hashes should only ever be used for balancing a hash table, any other use is not recommended.

openssl’s dgst command is convenient since it can read files or stdin as input, can output text or binary, and can sign/verify digests.

user@host:~$echo -n "hashme" | openssl dgst (-digest, default: -md5)

They’re basically used to “almost-identify” content. Whether you use them to build hash maps, or to build something like git, or to help dedup blocks on zfs, or to detect errors during file transfer over the network, or as part of some crypto digest certificate signing scheme, that’s up to you.

Different functions exist because they have different properties that make them more or less suitable to different use cases. For example, for most crypto related uses sha functions have a property that it’s hard to generate content that would have a particular hash value. In comparison crc is commonly used for error checking because it’s cheap to compute for the resilience that it offers, but it’s totally not good for crypto digests, and so on.

3 Likes

Yeah I’m just realising when I read up on that it was in the context of generating a unique Id as an int and I was contemplating using the GetHashCode method from .NET which when I read up on is pretty unreliable. I guess that was for a specfic case, I should have mentioned that haha

In that case look into cryptographic random number generators, not a hash functions. You could also create a UUID, if strings are ok.

GetHashCode is absolutely not meant for this purpose. The results aren’t unique either.

That was the thing, we had to use an int. And yes I avoided using GetHashCode after I did a bit of research.

Thank you all for you advice!

1 Like