Method and system for creating a perfect hash using an offset table
First Claim
1. In a computer system including a range of values, a method of converting a non-contiguous subset of values in the range into a contiguous or mostly contiguous smaller range with a perfect hash, comprising the steps of:
- selecting the subset of values from among the values in the range;
organizing the range into a two-dimensional matrix, one dimension of the matrix representing pages and the other dimension representing offsets into the pages, the matrix at each intersection of a page and offset into the page including mapping information therein indicative of whether the value represented by that intersection is a selected value in the subset; and
converting the matrix into a one-dimensional array by selecting each page, testing the mapping information on each page for conflicts with mapping information in the one-dimensional array, shifting each page an amount until no conflicts are detected, overlaying the mapping information in the page onto the one-dimensional array at the shifted position, and recording the shift amount.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and mechanism for converting a non-contiguous subset of values in a large range, such as selected Unicode code points, into a contiguous or mostly contiguous smaller range with a perfect hash. The large range is organized into a two-dimensional bitmap matrix of pages and offsets into the pages. The bits in the matrix equal one if the value is in the subset, and zero if not. The pages are then overlaid on one another into a one-dimensional bitmap by shifting each page as necessary to avoid conflicts with values on other pages. The shift amount is recorded and used in a hash computation, wherein a value of the large range is first separated into its page number and its offset into the page. The values are then hashed into the value of the dense subset range by looking up the shift amount for the page and adding the shift amount to the offset into the page.
68 Citations
22 Claims
-
1. In a computer system including a range of values, a method of converting a non-contiguous subset of values in the range into a contiguous or mostly contiguous smaller range with a perfect hash, comprising the steps of:
-
selecting the subset of values from among the values in the range; organizing the range into a two-dimensional matrix, one dimension of the matrix representing pages and the other dimension representing offsets into the pages, the matrix at each intersection of a page and offset into the page including mapping information therein indicative of whether the value represented by that intersection is a selected value in the subset; and converting the matrix into a one-dimensional array by selecting each page, testing the mapping information on each page for conflicts with mapping information in the one-dimensional array, shifting each page an amount until no conflicts are detected, overlaying the mapping information in the page onto the one-dimensional array at the shifted position, and recording the shift amount. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. In a computer system including a range of values, a mechanism for converting a non-contiguous subset of values in the range into a contiguous or mostly contiguous smaller range with a perfect hash, comprising:
-
means for selecting the subset of values from among the values in the range; means for organizing the range into a two-dimensional matrix, one dimension of the matrix representing pages and the other dimension representing offsets into the pages, the matrix at each intersection of a page and offset into the page including mapping information therein indicative of whether the value represented by that intersection is a selected value in the subset; and means for converting the matrix into a one-dimensional array by selecting each page, said means including means for testing the mapping information on each page for conflicts with mapping information in the one-dimensional array, means for shifting each page an amount until no conflicts are detected, means for overlaying the mapping information in the page onto the one-dimensional array at the shifted position, and means for recording the shift amount. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
-
Specification