Big Chemical Encyclopedia

Chemical substances, components, reactions, process design ...

Articles Figures Tables About

Update and retrieval in direct access files using hash algorithm

5 Update and retrieval in direct access files using hash algorithm [Pg.78]

Before any large number or alphanumeric key is used for addressing a record in the direct access file, it must be transformed into a number between 1 and N, N being the length of this file. The procedure employed for such transformation is called hash algorithm (ref. 5). [Pg.78]

Hash algorithms are widely used in many applications and there is a number of different approaches how to transform a long (large) number or multi-byte string into a short address in a unique way. [Pg.78]

Any such algorithms must inevitably cause more different input keys to produce identical address. This effect which is immanent to all hash algorithms is known as the address collision and programers must provide a way to calculate the consecutive addresses (an address increment) until an adequate address is reached. [Pg.79]

One of the most commonly used hash algorithm employs twin prime numbers (two consecutive odd numbers that are both primes) and modulo function. If KEY is a large number (fragment ID or XOR-ed parts of chopped long string) and NP the length of the direct access file than the calculated address ADDR and the increment INCR can be obtained by the following equations  [Pg.80]




SEARCH



Access files

Direct access

Direct-access-file

Hashing

Ins file

Retrieval

Update

© 2024 chempedia.info