Q: hashing is always one way?
A1: live answered
A2: live answered
Q: how do sites that tell you "you have used this password before" work?
A1: live answered
A2: They can compare the hash of the password youâre trying to enter with previous hases theyâves tored (but notice they still never store your actual old password)
Q: what's the benefit of hashing a password vs keeping it on file?
A1: live answered
A2: Security!!
A3: If someone hacks the website, they wonât be able to recover your password from the hash
Q: So websites cannot âdecryptâ your hash to get your original password?
A1: Correct
Q: why is facebook creating similar passwords?
A1: why is facebook doing a lot of the things it does? :^)
A2: real answer is that they want to make the user login experience better
A3: I highly recommend âThe Social Dilemmaâ â queue it up to watch over winter break
Q: Is there any signal processing involved, or is it just the hash?
A1: Yes, it does have to sample/squash the audio into the hashcode
Q: Why are you multiplying the first value by 26?
A1: live answered
Q: Should word[0] - âaâ be in parentheses?
A1: Correct!
Q: so do "at" and "t" have the same value, and is this a problem?
A1: live answered
Q: Why are we using *1 for the second letter? Also can we go through the example of 3 / 4 letter words?
A1: live answered
A2: For this example, we have only 2-letter words â later we will generalize, hang on!
Q: Shouldn't it be (letter[] - 'a') * 26?
A1: Correct!
Q: Wouldn't this leave a lot of empty spaces for non existant words like 'aa'?
A1: Correct
Q: Is table a map data structure?
A1: Could be, yes.
Q: How do we have arrays with indexes?
A1: live answered
Q: where in memory is this stored?
A1: live answered
Q: so we are converting âoxâ into the index where we store its definition
A1: live answered
A2: yes, exactly
Q: If it is possible for different words have same hash number?
A1: It is possible for this to happen! You have to make a list of possible options in this case
Q: do they have to be unique too?
A1: We call these âcollisionsâ and will have to deal with these eventually â hang on!
Q: so we want to basically avoid having hash values that map to nowhere
A1: live answered
Q: What if two hashes are the same mod N?
A1: live answered
Q: What does deterministic mean again?
A1: Same input always produces same output (no randomness)
Q: why is it better that our data is more spread out? how does that help out hashing?
A1: live answered
Q: Would be tought to sort too
A1: yup good point
Q: Since hashtables have one key for every value, why wouldnât it be easy to find the key given a value? (Ie. find the password of a user)
A1: If the table stored the strings, yes, but passwords are not typically stored in a table of all passowrds (i.e. password is not used as key), what is typically stored is only the hashed value with the userâs account, key is username, and value is hash code for password
Q: Why do we use a linked list instead of a vector?
A1: could also use a vector
Q: so if you're storing "table", would you need a double pointer, because the array is storing pointers?
A1: live answered
Q: can you chain it using a binary search tree?
A1: live answered
A2: that is another possible option, yup
A3: Keep in mind, the plan is to make each bucket very small/short, and wonât need to be aggressive about optimizing per-bucket acess
Q: is a hashset basically a chain of sets in a hashtable
A1: No. A hashtable is a set that uses hashing for storage as opposed to another approach, like a tree
Q: What is the harm of adding a bunch of buckets?
A1: live answered
Q: is rand() implemented as a hash function?
A1: No, randomness generation is usually done using other methods i believe
A2: however, the output of a great hash funciton will appear random
Q: if you have time, could you talk about the hashzam implementation?
A1: on monday!
Q: So because you generally have more buckets than number of elements (Load Factor below 1), does this mean you usually want to have some empty buckets ?
A1: live answered
A2: yup, exactly!
Q: How is the modulus used for hash keys?
A1: live answered
Q: Wonât the frequencies recorded have a bit of error due to the microphone, resulting in a different hash?
A1: live answered
Q: How does the Hashzam avoid collisions? Does it store the frequency of the songs in the linked lists? or the name
A1: live answered