patchWeeChat - Patches: patch #8062, Better hash function for the nick...


patch #8062: Better hash function for the nick colors

Submitted by:  Antoine Pietri <seirl>
Submitted on:  Thu 30 May 2013 01:56:27 PM UTC  
Votes:  100  
Category: irc pluginPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Sebastien Helleu <flashcode>Open/Closed: Closed
IRC nick: seirl

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sun 02 Jun 2013 09:06:20 PM UTC, comment #1:

Done, with a new option: irc.look.nick_color_hash, values: sum (default) or djb2.

Sebastien Helleu <flashcode>
Project AdministratorIn charge of this item.
Thu 30 May 2013 01:56:27 PM UTC, original submission:

Currently the hash function used to color nicks in the IRC plugin is a simple sum of every unicode character of the colored nick.
This causes some problems :

  • Two nicks that are identical except some permutated letters (alice and ailce) will display identically;
  • Speaking more generally, similar nicks (alice and alidd), instead of being visually distinguished by the colors, are more likely to appear identically and being confused more easily.

Using a hash function with a better randomized repartition (in this case, the djb2 algorithm) is a way of solving this problem.

Antoine Pietri <seirl>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #28211:  irc-nick.c.patch added by seirl (234B - text/x-patch - Patch for src/plugins/irc/irc-nick.c, updated with the modified djb2 hash of src/core/wee-hashtable.c:89)
file #28210:  irc-nick.c.patch added by seirl (183B - text/x-patch - Patch for src/plugins/irc/irc-nick.c)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by flashcode (Posted a comment)
  • -unavailable- added by seirl (Voted in favor of this item)
  • -unavailable- added by seirl (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 100 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 06 Oct 2013 07:48:44 AM UTCflashcodeOpen/ClosedOpen=>Closed
    Sun 02 Jun 2013 09:06:20 PM UTCflashcodeStatusNone=>Done
      Assigned toNone=>flashcode
    Thu 30 May 2013 02:46:35 PM UTCseirlCarbon-Copy-=>Added seirl
    Thu 30 May 2013 02:32:27 PM UTCseirlAttached File-=>Added irc-nick.c.patch, #28211
    Thu 30 May 2013 01:56:27 PM UTCseirlAttached File-=>Added irc-nick.c.patch, #28210

    Back to the top

    Powered by Savane 3.1-cleanup