Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit497f9e8

Browse files
committed
Unvendor fnv1a
1 parent7d97d10 commit497f9e8

File tree

4 files changed

+117
-1536
lines changed

4 files changed

+117
-1536
lines changed

‎assets/bindata.go‎

Lines changed: 111 additions & 111 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎client/js/utils/color.js‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
1-
/* eslint-disable no-bitwise */
21
import{hsluvToHex}from'hsluv';
3-
4-
//
5-
// github.com/sindresorhus/fnv1a
6-
//
7-
constOFFSET_BASIS_32=2166136261;
8-
9-
constfnv1a=string=>{
10-
lethash=OFFSET_BASIS_32;
11-
12-
for(leti=0;i<string.length;i++){
13-
hash^=string.charCodeAt(i);
14-
15-
// 32-bit FNV prime: 2**24 + 2**8 + 0x93 = 16777619
16-
// Using bitshift for accuracy and performance. Numbers in JS suck.
17-
hash+=
18-
(hash<<1)+(hash<<4)+(hash<<7)+(hash<<8)+(hash<<24);
19-
}
20-
21-
returnhash>>>0;
22-
};
2+
importfnv1afrom'@sindresorhus/fnv1a';
233

244
constcolors=[];
255

‎client/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"workbox-webpack-plugin":"^5.1.3"
6060
},
6161
"dependencies": {
62+
"@sindresorhus/fnv1a":"^2.0.0",
6263
"autolinker":"^3.14.1",
6364
"backo":"^1.1.0",
6465
"classnames":"^2.2.6",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp