Hash functions


Closed Thread
Results 1 to 4 of 4

Thread: Hash functions

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,809

    Default Hash functions

    In a project I will use some iButton keys like DS1922 for access control. I prefer to use a stand alone PIC with EEPROM memory to store the keys in.

    If the keys are more that, say, 20 then the search time increses to much. Does anyone have any experience with Hash Functions to code the unique iButton serial number into a memory address to find it then instantly?

    Thanks,
    Ioannis

  2. #2
    Join Date
    Feb 2005
    Location
    Holmfirth England
    Posts
    116


    Did you find this post helpful? Yes | No

    Default

    Hi

    If your using a 4MHz osc you could try using 20MHz, that would be 5 upto times faster, depending on the commands used.

    Regards
    Bob...

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Ioannis,

    I>>Does anyone have any experience with Hash Functions to code the unique iButton serial number into a memory address to find it then instantly?<<

    Ouch...Unless you can use a "function" to calculate your address directly, you are talking about time. Some Hashing routines use functions as such. The other Hash routines will probably require more time in calculating , then it would be to read the data and compare. How many items will you have?

    Can you store them in a ASCII logical order and do a Binary Search routine?
    This will limit your number of reads down. if you have 256 items (like in a table) you would find (worse case senario) 8 reads to have your value.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,809


    Did you find this post helpful? Yes | No

    Default

    Thanks for the replies.

    Well a 20 MHz xtal is not the best since speeding up to 5 times is not enough. There will be an incresing number of keys and may reach up to 300 or 400. Imagine a PIC searching 400 6-8 byte numbers!!!

    The binary tree is a good option. Did not think about it.

    Thanks again.

    Ioannis

Similar Threads

  1. Hash function
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 7th September 2007, 10:09
  2. Functions in Pic Basic Pro
    By bumlife in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 4th April 2007, 21:59
  3. Subs and functions
    By bearpawz in forum PBP Wish List
    Replies: 0
    Last Post: - 27th December 2006, 06:38
  4. Replies: 2
    Last Post: - 13th December 2005, 00:11
  5. Functions
    By AndyP in forum PBP Wish List
    Replies: 4
    Last Post: - 6th May 2005, 12:00

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts