minimum perfect hash function (BDZ algorithm)