Questions tagged [hashalgorithm]
32 questions
13
votes
3 answers
Why is ComputeHash not acting deterministically?
I've run into an interesting issue.. It seems that ComputeHash() for a "HMACSHA256" hash is not behaving deterministically.. if I create two instances of HashAlgorithm using HashAlgorithm.Create("HMACSHA256").. And run ComputeHash, I get two…

Josh Handel
- 1,690
- 2
- 13
- 21
11
votes
2 answers
Is it possible to copy a .NET HashAlgorithm (for repeated incremental hash results)?
I have the following use case:
Read n bytes from a file
Compute (MD5) hash for these n bytes
Read next m bytes from file
Compute (MD5) hash for the file up to n+m bytes
Incrementally hashing a file isn't the problem, just call TransformBlock and…

Martin Ba
- 37,187
- 33
- 183
- 337
7
votes
3 answers
.NET: Disposing a HashAlgorithm object
Objects that derive from HashAlgorithm such as MD5CryptoServiceProvider have a Dispose() method, but it's private. Instead it has a Clear() method which "Releases all resources" used by it.
WTF?
Is this how to correctly dispose of a HashAlgorithm…

core
- 32,451
- 45
- 138
- 193
5
votes
2 answers
Difference between Hashlib and System.Security.Cryptography.HashAlgorithm
I am trying to understand how hashing algorithms works, specially SHA3-512. To see how it works I searched for codes in Google and came across with Hashlib. The code doesn't work as I don't have the Hashlib library (not sure what it should be…

Giliweed
- 4,997
- 8
- 26
- 35
5
votes
1 answer
How can I calculate a CRC32 as a signed integer in C#?
I'm a PHP developer and a little out of my element in C#. In PHP, there's a crc32() function which returns a signed integer for any string that you pass in.
So this is what I'm used to:

soapergem
- 9,263
- 18
- 96
- 152
3
votes
2 answers
hashing password giving different results
I am taking over a system that a previous developer wrote. The system has an administrator approve a user account and when they do that the system uses the following method to hash a password and save it to the database. It sends the unhashed…

geoff
- 119
- 1
- 4
- 13
3
votes
1 answer
Can I just pass null as "output buffer" parameter of HashAlgorithm.TransformBlock()?
HashAlgorithm.TransformBlock() has outputBuffer parameter which is documented as A copy of the part of the input array used to compute the hash code. which sounds like my data will be read, used to alter the hash mechanism state and also copied to…

sharptooth
- 167,383
- 100
- 513
- 979
3
votes
6 answers
Java hashtable or hashmap?
I've been researching to find a faster alternative to list. In an algorithm book, hashtable seems to be the fastest using separate chaining. Then I found that java has an implementation of hashtable and from what I read it seems to it uses separate…

WhatIf
- 653
- 2
- 8
- 18
3
votes
3 answers
Fastest and LightWeight Hashing Algorithm for Large Files & 512 KB Chunks [C,Linux,MAC,Windows]
I'm working on a Project which involves computation of Hashes for Files. The Project is like a File Backup Service, So when a file gets uploaded from Client to Server, i need to check if that file is already available in the server. I generate a…

Manikandaraj Srinivasan
- 3,557
- 5
- 35
- 62
3
votes
1 answer
C# GetHashCode() High Performance Hashing Algorithm
Possible Duplicate:
What is the best algorithm for an overridden System.Object.GetHashCode?
This is known to us that if we override the Equals method of Object in our custom types, we should also override and provide an implementation of…

S2S2
- 8,322
- 5
- 37
- 65
2
votes
2 answers
How to switch hash_algos() on ? I'm with Php 5.2.11
My PHP version is 5.2.11 which is higher than the required version for hash_algos. however, when I run it either via web or command line, it returns
Fatal error: Call to undefined function hash_algos()
So as for other Hash functions.
Do i have…

murvinlai
- 48,919
- 52
- 129
- 177
2
votes
3 answers
Is there any difference between SHA256.Create() and HashAlgorithm.Create("SHA-256")?
Do these two code blocks return the same thing? Assume arr is the same byte[] in both examples:
Code sample 1
HashAlgorithm a = HashAlgorithm.Create("SHA-256");
var result = a.ComputeHash(arr);
Code sample 2
SHA256 b = SHA256.Create();
var result =…

Ali Foroughi
- 4,540
- 7
- 42
- 66
1
vote
1 answer
Microsoft Dynamics CRM - password hashing algorithm
I work at a University and our application for admissions is a product that is built on top of Microsoft Dynamics CRM 4.0. (The application is called 'Recruiter'.)
There is a table with usernames and hashed passwords. I would like to write an app…

Teddy
- 18,357
- 2
- 30
- 42
1
vote
1 answer
tymon/jwt-auth Laravel: Token Signature could not be verified
I am getting an access_token from third party successful login.Now i want to decode this token using tymon/jwt-auth and get the payload from that token. When i try to decode same token using JWT IO debugger, it successfully decodes the token and…

Mira Thakkar
- 339
- 1
- 6
- 19
1
vote
1 answer
CRC32 as .NET HashAlgorithm and endianness
CRC32 is calculated as uint32, while HashAlgorithm in .NET by convention returns byte[]. I can, of course, easily convert it with bytes = BitConverter.GetBytes(hash) but this is affected by "endianness" of a system (almost no chance for big-endian,…

Milosz Krajewski
- 1,160
- 1
- 12
- 19