hash

Calculating MD5 of string from Microsoft Access

How do I calculate an MD5 of a string client side in Microsoft Access? ...

Best way to Implement a MySQL Hash Table?

Background I'm currently developing an online community and I want to store some temporary information in a hash table. Currently this information is being stored in memcached, however, should the memcached service need to be restarted or failed, I would like to resort back to the on disk hash/cache. The Question What is the most effe...

Is it possible to define anonymous subroutines in a hash constructor in Perl?

Is it possible to define anonymous subroutines in a hash constructor in Perl? I'm trying to do something like this: my %array = { one => sub { print "first $_[0]" }, two => sub { print "next $_[0]" }, three => sub { print "last $_[0]" }}; $array{$foo}->('thing'); But it isn't working. The code seem...

What's the purpose in hashing information?

After being taught how to create a hash table in class, I don't understand when hashing data would be useful. It seems to me that all hashing does is storing information in semi-random positions in an array. I want to know how any of the data can be made useful after it's stored. My question is this: what are some examples where hashi...

How to convert this sequence to this hash?

Hi there, I'm consuming a webservice from my application in C# .net (2.0) that return values (as string) like this: %23k.%0d%16%c4%8a%18%efG%28%b9c%12%b7%f1%e2%e7j%93 I know that the real value for that is: 236B2E0D16C48A18EF4728B96312B7F1E2E76A93 But I don't know how to convert from the returned value to the real value. Any thou...

Non-random salt for password hashes

Typically, I always recommend using a cryptographically-strong random value as salt, to be used with hash functions (e.g. for passwords), such as to protect against Rainbow Table attacks. But is it actually cryptographically necessary for the salt to be random? Would any unique value (unique per user, e.g. userId) suffice in this rega...

How can I create multiple hashes of a file using only one pass?

How can I get a MD5, SHA and other hashes from a file but only doing one pass? I have 100mb files, so I'd hate to process those 100MB files multiple times. ...

Is using 2 different hash functions a good way to check for file integrity?

I have a website where users can upload their files; these are stored on the server and their metadata recorded in a database. I'm implementing some simple integrity checks, i.e. "is the content of this file now byte-for-byte identical as when it was uploaded?" An example: for content of userfile.jpg, MD5 hash is 39f9031a154dc7ba105eb4f...

Is there an IDictionary implementation that returns null on missing key instead of throwing?

The indexer into Dictionary throws an exception if the key is missing. Is there an implementation of IDictionary that instead will return default(T)? I know about the "TryGetValue" method, but that's impossible to use with linq. Would this efficiently do what I need?: myDict.FirstOrDefault(a => a.Key == someKeyKalue); I don't think...

Looking for a Hash Function /Ordered Int/ to /Shuffled Int/

I am looking for constant time algorithm can change an ordered integer index value into a random hash index. It would nice if it is reversible. I need that hash key is unique for each index. I know that this could be done with a table look up in a large file. I.E. create an ordered set of all ints and then shuffle them randomly and write...

Questions about Php and Mysql Hash Table

I am a new php and mysql programmer. I am handling quite large amount of data, and in future it will grow slowly, thus I am using hash table. I have couple of questions: Does mysql have hash table built in function? If yes, how to use that? After couple of days doing research about hash table. I briefly know what hash table is but I ju...

How do I turn a table into a matrix?

If I got a table in a text file such like A B 1 A C 2 A D 1 B A 3 C D 2 A E 1 E D 2 C B 2 . . . . . . . . . And I got another symbol list in another text file. I want to transform this table into a Perl data structure like: _ A D E . . . A 0 1 1 . . . D 1 0 2 . . . E 1 2 0 . . . . . . . . . . But I only need some selected symbol...

How do I do a simple Perl hash equivalence comparison?

I'm wondering if there's an idiomatic one-liner or a standard-distribution package/function that I can use to compare two Perl hashes with only builtin, non-blessed types. The hashes are not identical (they don't have equivalent memory addresses). I'd like to know the answer for both for shallow hashes and hashes with nested collections...

How does a hash table work? Is it faster than "SELECT * from .."

Let's say, I have : Key | Indexes | Key-values ----+---------+------------ 001 | 100001 | Alex 002 | 100002 | Micheal 003 | 100003 | Daniel Lets say, we want to search 001, how to do the fast searching process using hash table? Isn't it the same as we use the "SELECT * from .. " in mysql? I read alot, they say, the "SELECT *" sea...

How can I merge lines in a large, unsorted file without running out of memory in Perl?

I have a very large column-delimited file coming out of a database report in something like this: field1,field2,field3,metricA,value1 field1,field2,field3,metricB,value2 I want the new file to have combine lines like this so it would look something like this: field1,field2,field3,value1,value2 I'm able to do this using a hash. In t...

Fixed Length numeric hash code from variable length string in c#

I need to store fixed-length (up to 8 digits) numbers produced from a variable length strings. The hash need not be unique. It just needs to change when input string changes. Is there a hash function in .Net that does this? Thanks Kishore. ...

setting top.location.hash with %20 in firefox

In firefox, using this javascript: top.location.hash = "#here%20are%20spaces"; changes the browser url to: http://mysite.com/#here are spaces I expected firefox to show the encoded spaces as %20 in the browser url. What's going on here? Why is firefox not setting the url to the string as I passed it? How can I force firefox to u...

Changing the hash but not moving the page using jquery ui tabs

I added the following code to change the hash to the tab name: $("#tabs > ul").tabs({ select: function(event, ui){ window.location.hash = ui.tab.hash; } } ); This works fine in FF3 but in IE7 it moves down the page (depending on the tab selected anywhere from somewhere near the top of the page all the way down to the very end of t...

Java port of Hash by Jenkins

I am looking for a java port of this file, Jenkins Hash in C ...

How do I secure authentication but not the payload?

I'm looking for an existing HTTP protocol for securing authentication but not the payload that follows. I want the server to store the username, hashed password and different salt per user. HTTP Digest Authentication fails these requirements because all accounts use the same salt. SSL fails because it encrypts the entire connection. Ed...