Skip to content

Commit 6beb3b5

Browse files
committed
Fix hashBigInt(), links to the repository
1 parent d6c6041 commit 6beb3b5

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
99
* Interface types: `ReadonlyHashMap`, `ReadonlyHashSet`.
1010
* Hash functions: `chainHash()`, `dropHighestNonSignBit()`, `hashBigInt()`, `hashNumber()`, `hashString()`, `hashTuple()`, `hashValue()`.
1111

12-
[0.1.0]: https://github.com/reactodia/reactodia-hashmap/compare/v0.0.0...v0.1.0
12+
[0.1.0]: https://github.com/reactodia/hashmap/compare/v0.1.0@{7days}...v0.1.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Utility function to compute a hash for a JS number:
111111

112112
#### `hashBigInt(value: bigint): number` function
113113

114-
Utility function to compute a hash for a `bigint` value with the following formula: `abs(N) % 0x1_0000_0000` where N is the `bigint` value.
114+
Utility function to compute a hash for a `bigint` value with the following formula: `abs(N) % 0x8000_0000` where N is the `bigint` value.
115115

116116
#### `hashValue(value: string | number | bigint | boolean | undefined | null)`
117117

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "HashMap and HashSet collections with composite keys and custom hash and equality functions",
55
"repository": {
66
"type": "git",
7-
"url": "git+ssh://git@github.com/reactodia/reactodia-hashmap.git"
7+
"url": "git+ssh://git@github.com/reactodia/hashmap.git"
88
},
99
"keywords": [
1010
"hashmap",
@@ -17,9 +17,9 @@
1717
},
1818
"license": "MIT",
1919
"bugs": {
20-
"url": "https://github.com/reactodia/reactodia-hashmap/issues"
20+
"url": "https://github.com/reactodia/hashmap/issues"
2121
},
22-
"homepage": "https://github.com/reactodia/reactodia-hashmap#readme",
22+
"homepage": "https://github.com/reactodia/hashmap#readme",
2323
"type": "module",
2424
"main": "dist/index.js",
2525
"typings": "dist/index.d.ts",

src/hashCode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function hashNumber(num: number): number {
4444
}
4545

4646
export function hashBigInt(value: bigint): number {
47-
return Number((value >= 0n ? value : -value) % 0x100000000n);
47+
return Number((value >= 0n ? value : -value) % 0x80000000n);
4848
}
4949

5050
type PrimitiveValue = string | number | boolean | bigint | undefined | null;

0 commit comments

Comments
 (0)