Python Forum
Code that generates MD5 hashes from IPv6 addresses giving differant answers?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code that generates MD5 hashes from IPv6 addresses giving differant answers?
#4
if you know C (I expect the hash algorithm is written in C) you might want to take a look at the two algorithms.
Most that I have written or borrowed (I used a modified of Aho's from the dragon book) were actually quite simple,
usually fed a seed that was the size of the hash table, manipulating the key through an iterative process of masks and
bit shifts. only a few lines of code.

What you did with it afterwards is where it can get more complicated (although, with care, this can be simple as well). The one that I used for processing
a days worth of phone calls (~80 million calls) used a lateral extension, which was actually a linked list, when a collision was encountered. By using the
size of the table as part of the has, the distribution was very even. The linked list handling of collisions had the (very good) side effect of not running
out of space.

This algorithm could process (identify customer, distance between points, number of points, segment rating, etc.) in twenty minutes.
The lateral lists never got too long, so caused little delay.

I got into hashing in a big way, saving a few computer cycles on a single call really added up when you were processing so many.

Should you get interested and investigate the python hashes, I'd be interested in what you find.

Larz60+
Reply


Messages In This Thread
RE: One of these things is not like the other... - by Larz60+ - Oct-16-2016, 06:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  'answers 2' is not defined on line 27 0814uu 4 808 Sep-02-2023, 11:02 PM
Last Post: 0814uu
  Compiles Python code with no error but giving out no output - what's wrong with it? pythonflea 6 1,666 Mar-27-2023, 07:38 AM
Last Post: buran
  Non cryptographic hashes AndrzejB 3 884 Mar-21-2023, 07:36 PM
Last Post: AndrzejB
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 1,005 Feb-15-2023, 05:34 PM
Last Post: zsousa
  a function to get IP addresses of interfaces Skaperen 2 1,478 May-30-2022, 05:00 PM
Last Post: Skaperen
  Loop through list of ip-addresses [SOLVED] AlphaInc 7 4,181 May-11-2022, 02:23 PM
Last Post: menator01
  Division calcuation with answers to 1decimal place. sik 3 2,186 Jul-15-2021, 08:15 AM
Last Post: DeaD_EyE
  instance methods sharing addresses mim 1 2,278 Mar-28-2021, 05:22 AM
Last Post: deanhystad
  Convert email addresses to VCF format jehoshua 2 4,755 Mar-06-2021, 12:50 AM
Last Post: jehoshua
  Cannot Assign right Answers To Shuffled Questions Boblows 6 2,832 Jan-22-2021, 09:41 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020