@sindresorhus/fnv1a 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +22 -5
- package/index.js +1 -0
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const fnv1a: {
|
|
2
|
+
/**
|
|
3
|
+
[FNV-1a](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function) non-cryptographic hash function.
|
|
3
4
|
|
|
4
|
-
@
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
@returns The hash as a positive integer.
|
|
6
|
+
|
|
7
|
+
@example
|
|
8
|
+
```
|
|
9
|
+
import fnv1a = require('@sindresorhus/fnv1a');
|
|
10
|
+
|
|
11
|
+
fnv1a('🦄🌈');
|
|
12
|
+
//=> 582881315
|
|
13
|
+
```
|
|
14
|
+
*/
|
|
15
|
+
(string: string): number;
|
|
16
|
+
|
|
17
|
+
// TODO: remove this in the next major version, refactor the whole definition to:
|
|
18
|
+
// declare function fnv1a(string: string): number;
|
|
19
|
+
// export = fnv1a;
|
|
20
|
+
default: typeof fnv1a;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export = fnv1a;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sindresorhus/fnv1a",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "FNV-1a non-cryptographic hash function",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/fnv1a",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"node": ">=6"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"test": "xo && ava && tsd
|
|
16
|
+
"test": "xo && ava && tsd"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"vo"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"ava": "^1.
|
|
40
|
-
"tsd
|
|
39
|
+
"ava": "^1.4.1",
|
|
40
|
+
"tsd": "^0.7.1",
|
|
41
41
|
"xo": "^0.24.0"
|
|
42
42
|
}
|
|
43
43
|
}
|