fix undefined

This commit is contained in:
Tom (plebeius.eth)
2024-08-13 21:40:34 +02:00
parent c354d72e0a
commit 77980ee0c6
+4
View File
@@ -1,4 +1,8 @@
export function hashStringToColor(str: string): string {
if (!str) {
return '';
}
let hash = 0;
for (let i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash);