Hashing Project by: Omar Benismail Comp3801.

Slides:



Advertisements
Similar presentations
© 2004 Goodrich, Tamassia Hash Tables1  
Advertisements

Maps. Hash Tables. Dictionaries. 2 CPSC 3200 University of Tennessee at Chattanooga – Summer 2013 © 2010 Goodrich, Tamassia.
Using arrays – Example 2: names as keys How do we map strings to integers? One way is to convert each letter to a number, either by mapping them to 0-25.
Hashing Techniques.
Hash Tables How well do hash tables support dynamic set operations? Implementations –Direct address –Hash functions Collision resolution methods –Universal.
Dictionaries and Hash Tables1  
Look-up problem IP address did we see the IP address before?
1 CSE 326: Data Structures Hash Tables Autumn 2007 Lecture 14.
Hash Tables1 Part E Hash Tables  
Hash Tables1 Part E Hash Tables  
Tirgul 9 Hash Tables (continued) Reminder Examples.
Hash Tables1 Part E Hash Tables  
Tirgul 7. Find an efficient implementation of a dynamic collection of elements with unique keys Supported Operations: Insert, Search and Delete. The keys.
COMP 171 Data Structures and Algorithms Tutorial 10 Hash Tables.
Tirgul 8 Hash Tables (continued) Reminder Examples.
Hashing General idea: Get a large array
1. 2 Problem RT&T is a large phone company, and they want to provide enhanced caller ID capability: –given a phone number, return the caller’s name –phone.
Symbol Tables Symbol tables are used by compilers to keep track of information about variables functions class names type names temporary variables etc.
Hashing Table Professor Sin-Min Lee Department of Computer Science.
Hash Tables.
Hash Tables1   © 2010 Goodrich, Tamassia.
David Luebke 1 10/25/2015 CS 332: Algorithms Skip Lists Hash Tables.
Comp 335 File Structures Hashing.
MSU/CSE 260 Fall Functions Read Section 1.8.
Hashing Hashing is another method for sorting and searching data.
CS201: Data Structures and Discrete Mathematics I Hash Table.
LECTURE 35: COLLISIONS CSC 212 – Data Structures.
Hashing Chapter 7 Section 3. What is hashing? Hashing is using a 1-D array to implement a dictionary o This implementation is called a "hash table" Items.
Tirgul 11 Notes Hash tables –reminder –examples –some new material.
Midterm Midterm is Wednesday next week ! The quiz contains 5 problems = 50 min + 0 min more –Master Theorem/ Examples –Quicksort/ Mergesort –Binary Heaps.
CHAPTER 9 HASH TABLES, MAPS, AND SKIP LISTS ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++,
CS6045: Advanced Algorithms Data Structures. Hashing Tables Motivation: symbol tables –A compiler uses a symbol table to relate symbols to associated.
CSC 413/513: Intro to Algorithms Hash Tables. ● Hash table: ■ Given a table T and a record x, with key (= symbol) and satellite data, we need to support:
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
Hashing (part 2) CSE 2011 Winter March 2018.
Hashing Jeff Chastine.
COMP 53 – Week Eleven Hashtables.
Hashing CSE 2011 Winter July 2018.
School of Computer Science and Engineering
CS 332: Algorithms Hash Tables David Luebke /19/2018.
Hashing Alexandra Stefan.
Dictionaries Dictionaries 07/27/16 16:46 07/27/16 16:46 Hash Tables 
© 2013 Goodrich, Tamassia, Goldwasser
Dictionaries 9/14/ :35 AM Hash Tables   4
Hash functions Open addressing
CS223 Advanced Data Structures and Algorithms
Hash Table.
Hash In-Class Quiz.
Dictionaries and Hash Tables
Resolving collisions: Open addressing
CH 9.2 : Hash Tables Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and.
Dictionaries and Hash Tables
Hashing Alexandra Stefan.
Dictionaries 1/17/2019 7:55 AM Hash Tables   4
CH 9.2 : Hash Tables Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and.
A Hash Table with Chaining
Chapter 11: Hash Tables.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Hashing Sections 10.2 – 10.3 Lecture 26 CS302 Data Structures
Pseudorandom number, Universal Hashing, Chaining and Linear-Probing
Chapter 11: Hash Tables.
CS223 Advanced Data Structures and Algorithms
CS210- Lecture 16 July 11, 2005 Agenda Maps and Dictionaries Map ADT
CS 3343: Analysis of Algorithms
Slide Sources: CLRS “Intro. To Algorithms” book website
Collision Resolution.
Jordi Cortadella and Jordi Petit Department of Computer Science
DATA STRUCTURES-COLLISION TECHNIQUES
DATA STRUCTURES-COLLISION TECHNIQUES
Dictionaries and Hash Tables
Presentation transcript:

Hashing Project by: Omar Benismail Comp3801

In this presentation: What is hashing? Types of hashing that I covered. Secure hashing. Min-Hashing. Best hashing algorithm.

A hash function is any function that can be used to map data of arbitrary size to data of fixed size.

A good hash function will arbitrarily map a value to a hash code with equal probability. One common problem is when our universe far exceeds the size of our hashing codes (PHP)

What happened since the last presentation?

Types of hashing that I covered Secure hashing Min-Hashing

Secure Hashing SHA -series MDS -series

Secure Hashing (cont.) Speed isn’t an issue Could have really complex algos. Hash codes have a larger size

Secure Hashing (cont. 2)

SHA-1 and MDS-5 http://www.miraclesalad.com/webtools/md5.php https://crackstation.net/

Min-Hashing Hashes in constant time Hash codes are usually small numbers Usually converts the keys to natural numbers (for speed) Sometimes implies a hash-table

Min-Hashing & Hash-tables For m = size of table For k = key entered

Simple algorithms Division method H(k)= k mod m If m = 2 𝑝 bad

Simple algorithms Division method H(k)= k mod m If m = 2 𝑝 -1 better multiplication method H(k)= m(kA mod 1)

Universal hashing Uses random hash functions that are independent of the key inputted We set p to a large prime number.

Universal hashing ha,b (k) = ((a*k + b) mod p) mod m h(k) = ((a*k)mod 2 𝑤 ) div 2 𝑤−𝑑

Dealing with collisions chaining Θ(1 + α)

Dealing with collisions Linear probing One problem is resizing

Perfect hashing

Best hashing algorithm is…. Depends

Questions What is the main difference between secure hashing and minHashing / universalHashing? What type of mapping function (secure or universal) would you use for these tasks: Converting a password to a hash-code For storing items in a hash-table Implementing bloom’s filter Implementing a cryptographic hashing algorithm 3. Describe one example from class where hashing was used. 4. Describe one of the hash table implantations that deals with collisions. 5. That is the main constraint for a perfect hashing algorithm to work? 6. From the slides What do the values a, b and m represent?