1. A network device, comprising: a hash memory comprising a plurality of hash tables, wherein each hash table comprises a plurality of entries, and each entry in each hash table comprises a signature field and a key field; a controller, configured to map a search key to a plurality of entries of the hash tables, and perform longest prefix matching (LPM) on the search key based on the signature field and the key field of each mapped entry in the hash tables.