Difference between HashMap and HashTable purely in Data Structures

In Computing Science terminology, a map is an associative container mapping from a key to a value. In other words, you can do operations like “for key K remember value V” and later “for key K get the value”. A map can be implemented in many ways – for example, with a (optionally balanced) binary … Read more

Uniform distribution of truncated md5?

Yes, not exhibiting any bias is a design requirement for a cryptographic hash. MD5 is broken from a cryptographic point of view however the distribution of the results was never in question. If you still need to be convinced, it’s not a huge undertaking to hash a bunch of files, truncate the output and use … Read more

What is the clash rate for md5? [closed]

You need to hash about 2^64 values to get a single collision among them, on average, if you don’t try to deliberately create collisions. Hash collisions are very similar to the Birthday problem. If you look at two arbitrary values, the collision probability is only 2-128. The problem with md5 is that it’s relatively easy … Read more

How Do Hardware Token Devices work? [closed]

This has very little to do with hash functions. A cryptographic hash function may be part of the implementation, but it’s not required. Actually, it generates the digits on a time-based interval, if I press the button for it to generate the digits, it generates the digits and after about 25 seconds, and I press … Read more

Base64 Encoding safe for filenames?

Modified Base64 (when /,= and + are replaced) is safe to create names but does not guarantee reverse transformation due to case insensitivity of many file systems and urls. Base64 is case sensitive, so it will not guarantee 1-to-1 mapping in cases of case insensitive file systems (all Windows files systems, ignoring POSIX subsystem cases). … Read more

Why is it not possible to reverse a cryptographic hash?

MD5 is designed to be cryptographically irreversible. In this case, the most important property is that it is computationally unfeasible to find the reverse of a hash, but it is easy to find the hash of any data. For example, let’s think about just operating on numbers (binary files after all, could be interpreted as … Read more

error for hash function of pair of ints

Unfortunately, this program has undefined behavior. C++11 §17.6.4.2.1: A program may add a template specialization for any standard library template to namespace std only if the declaration depends on a user-defined type and the specialization meets the standard library requirements for the original template and is not explicitly prohibited. hash<pair<int,int>> depends on primitive and standard … Read more