mirror of
https://github.com/thelounge/thelounge
synced 2024-11-11 15:07:14 +00:00
Add reminder that ascii is awesome.
This commit is contained in:
parent
dc6ca963f5
commit
3a89935c29
1 changed files with 5 additions and 0 deletions
|
@ -8,5 +8,10 @@ module.exports = function(str) {
|
|||
hash += str.charCodeAt(i);
|
||||
}
|
||||
|
||||
/*
|
||||
Modulo 32 lets us be case insensitive for ascii
|
||||
due to A being ascii 65 (100 0001)
|
||||
while a being ascii 97 (110 0001)
|
||||
*/
|
||||
return "color-" + (1 + hash % 32);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue