hash

C# MD5 Hash results not expected result

Hi, I've tried every example I can find on the web but I cannot get my .NET code to produce the same MD5 Hash results from my VB6 app. The VB6 app produces identical results to this site: http://www.functions-online.com/md5.html But I cannot get the same results for the same input in C# (using either the MD5.ComputeHash method or the ...

Is Perl guaranteed to return consistently-ordered hash keys?

Given something like foreach (keys %myHash) { ... do stuff ... } foreach (keys %myHash) { ... do more stuff ... } Is Perl guaranteed to iterate over the keys in a consistent order if the hash is not altered? ...

Can I use an already MD5 encoded password in Digest Authentication

I have MD5 hashes of passwords in a database that I want to use against HTTP AUTH DIGEST. But in reading the docs, it looks like the digest hash contains a hash of the username,realm and plaintext password. Is there any way to use the MD5 hash of the password in this situation? ...

Tricky transform of hash -> array

I have a structure like this: {:foo => ['foo1', 'foo2'], :bar => ['bar1']} Which I would like to have transformed into: [[:foo, "foo1"], [:foo, "foo2"], [:bar, "bar1"]] My current solution is imperative: result = [] h.each do |k,v| v.each do |value| result << [k, value] end end While this works, I am certain that there i...

Convert binary string to bigint in MySQL?

I am attempting to hash a string to a 64-bit value (bigint) in MySQL. I am aware of the MD5() function, which returns a 128-bit hash as a binary string. I'd be happy to just take the bottom or top 64 bits of this result. However, I cannot figure out how to get from a binary string type to a numeric type of any sort. Any pointers? ...

enough using checksum

How would you do that? You are sending files which contains many lines.Every line is a record from database. All files are zipped toggether into one file. Is it enough to send a checksum with this file to ensure that other side received all records and none has disappear? ...

How to put elements of a file into a hash? -Ruby

So I have a file in the form of: Key1 Value1 Key2 Value2 Key3 Value3 seperated by a tab. My question is how do I open this file and put it into a hash? I have tried to do: fp = File.open(file_path) fp.each do |line| value = line.chomp.split("\t") hash = Hash[*value.flatten] end But at the end of this loop the @dataf...

What does .NET Dictionary<T,T> use to hash a reference?

So I'm thinking of using a reference type as a key to a .NET Dictionary... Example: class MyObj { private int mID; public MyObj(int id) { this.mID = id; } } // whatever code here static void Main(string[] args) { Dictionary<MyObj, string> dictionary = new Dictionary<MyObj, string>(); } My question is, how...

How can I figure out which hash function was used?

I'm developing a network API to interact with a legacy server, and I need a little help figuring out which hashing function they're using. The original developers are not particularly responsive to my queries, so I thought that SO might help me out. This is a low-security, internal corporate network, so the hash isn't complicated. So ...

How do I compare two hashes in Perl without using Data::Compare?

How do I compare two hashes in Perl without using Data::Compare? ...

How does Microsoft generate the Event ID for winqual events?

I am curious about the IDs that are used to identify items in winqual. I assume it is some sort of hash. Is this published? Hash of the module name, its version and an offset? That seems appropriate but the size is too small to cover the possibilities unless some truncation/lossy algorithm is used. This seems to be generated with th...

Converting a Double to an Integer for GetHashCode in Delphi

Delphi 2009 added the GetHashCode function to TObject. GetHashCode returns an Integer which is used for hashing in TDictionary. If you want an object to work well in TDictionary, you need to override GetHashCode appropriately such that, in general, different objects return different integer hash codes. But what do you do for objects c...

Are unique indexes better for column search performance? (PGSQL & MySQL)

I am curious as to whether CREATE INDEX idx ON tbl (columns); vs. CREATE UNIQUE INDEX idx ON tbl (columns); has a significant algorithmic performance benefit in PostgreSQL or MySQL implementations when scanning the indexed column(s), or whether the UNIQUE keyword simply introduces a unique constraint alongside the index. I imagin...

MD5 hash with salt for keeping password in DB in C#

Could you please advise me some easy algorithm for hashing user password by MD5, but with salt for increasing reliability. Now I have this one: private static string GenerateHash(string value) { var data = System.Text.Encoding.ASCII.GetBytes(value); data = System.Security.Cryptography.MD5.Create().ComputeHash(data); return ...

Shortest hash in python to name cache files

What is the shortest hash (in filename-usable form, like a hexdigest) available in python? My application wants to save cache files for some objects. The objects must have unique repr() so they are used to 'seed' the filename. I want to produce a possibly unique filename for each object (not that many). They should not collide, but if th...

Why would Google Search use client-side URL parameters?

Yesterday morning I noticed Google Search was using hash parameters: http://www.google.com/#q=Client-side+URL+parameters which seems to be the same as the more usual search (with search?q=Client-side+URL+parameters). (It seems they are no longer using it by default when doing a search using their form.) Why would they do that? Mor...

Calculating a SHA hash with a string + secret key in python

Amazon Product API now requires a signature with every request which I'm trying to generate ushing Python. The step I get hung up on is this one: "Calculate an RFC 2104-compliant HMAC with the SHA256 hash algorithm using the string above with our "dummy" Secret Access Key: 1234567890. For more information about this step, see documenta...

How do I create an array of hashes and loop through them in Perl?

I'm trying to create an array of hashes, but I'm having trouble looping through the array. I have tried this code, but it does not work: for ($i = 0; $i<@pattern; $i++){ while(($k, $v)= each $pattern[$i]){ debug(" $k: $v"); } } ...

Hash function combining - is there a significant decrease in collision risk?

Hi all. Does anyone know if there's a real benefit regarding decreasing collision probability by combining hash functions? I especially need to know this regarding 32 bit hashing, namely combining Adler32 and CRC32. Basically, will adler32(crc32(data)) yield a smaller collision probability than crc32(data)? The last comment here gives so...

Jquery XML Paging and Onload Hashcheck

Hi Folk can you help me? i will create a XML Parser with anchor/hash url. My problem is I get the hash / anchor from the URL does not load. Here js in HTML Template <script language="javascript" type="text/javascript"> $(document).ready(function() { BROADCAST.init({ xmlPath : "broadcast.xml", swfPath : "swf", ...