Skip to content

Commit

Permalink
fix: inline hyperdyperid (#1000)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Feb 17, 2024
1 parent dffd1c6 commit f26c244
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -121,7 +121,6 @@
}
},
"dependencies": {
"hyperdyperid": "^1.2.0",
"thingies": "^1.11.1",
"tslib": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/json-joy/util/buffers/utf8/CachedUtf8Decoder.ts
@@ -1,5 +1,5 @@
import decodeUtf8 from './decodeUtf8/v10';
import {randomU32} from 'hyperdyperid/lib/randomU32';
import {randomU32} from './randomU32';

class CacheItem {
constructor(public readonly bytes: Uint8Array, public readonly value: string) {}
Expand Down
7 changes: 7 additions & 0 deletions src/json-joy/util/buffers/utf8/randomU32.ts
@@ -0,0 +1,7 @@
let x = 1 + Math.round(Math.random() * ((-1>>>0)-1));

/** Generate a random 32-bit unsigned integer in the specified [min, max] range. */
export function randomU32(min: number, max: number): number {
x ^= x << 13; x ^= x >>> 17; x ^= x << 5;
return (x >>> 0) % (max - min + 1) + min;
}
5 changes: 0 additions & 5 deletions yarn.lock
Expand Up @@ -3533,11 +3533,6 @@ husky@^8.0.1:
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==

hyperdyperid@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b"
integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==

iconv-lite@0.4.24:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
Expand Down

0 comments on commit f26c244

Please sign in to comment.