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

 
 

patch #8062: Better hash function for the nick colors

Submitter:  Antoine Pietri <seirl>
Submitted:  Thu 30 May 2013 01:56:27 PM UTC
Votes:  100  
 
Category:  irc plugin Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  flashcode Open/Closed:  Closed
IRC nick:  seirl
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

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 Administrator
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 Files:
   
   
Comment:
   

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
  • -email is unavailable- added by flashcode (Posted a comment)
  • -email is unavailable- added by seirl (Voted in favor of this item)
  • -email is unavailable- added by seirl (Submitted the item)
  •  

    There are 100 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-06 flashcode Open/ClosedOpen Closed
    2013-06-02 flashcode StatusNone Done
        Assigned toNone flashcode
    2013-05-30 seirl Carbon-Copy- Added seirl
    2013-05-30 seirl Attached File- Added irc-nick.c.patch, #28211
    2013-05-30 seirl Attached File- Added irc-nick.c.patch, #28210

    Back to the top


    Powered by Savane 3.9