lecture5 - Lecture 5: The Hash Function Daniel Frances c...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 5: The Hash Function Daniel Frances c ± 2012 Contents 1 Hash functions 2 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1 Hash functions Suppose a company needs to store, and randomly access 100,000 Visa card numbers. Each visa number is a 16 digit code. How much storage is required? To randomly access each number we would need an array large enough to accommodate all possible 10 17 - 1 10 17 entries. Even if we stored 1 byte in each entry of the array we would need 10 17 bytes = 10 14 Kbytes = 10 11 Mb = 10 8 Gb. A lot of storage! The basis for the idea of a hash function is that of all possible 10 17 numbers we are only using 100,000 numbers, a very small percentage of the array. To be precise 10 5 10 - 17 10 2 = 10 - 10 percent of the entries! Perhaps we could manage with a much smaller array, say of 100,000 numbers, if we could somehow minimize the chances of storing more than one Visa number in the same location of the smaller array. We don’t have to rule out the possibility that more than one Visa number will refer to the same location of the smaller array. If that were to happen, i.e. if we
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/31/2012 for the course MIE 335 taught by Professor Frances during the Spring '12 term at University of Toronto- Toronto.

Page1 / 3

lecture5 - Lecture 5: The Hash Function Daniel Frances c...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online