Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: inline hyperdyperid #1000

Merged
merged 1 commit into from Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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