Skip to content

Commit

Permalink
Generate smaller inode IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Jan 6, 2025
1 parent 159c2ef commit 3ad0e94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/mixins/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export function Async<const T extends typeof FileSystem>(FS: T): Mixin<T, AsyncM
// @ts-expect-error 2556
this._sync?.[`${key}Sync` as const]?.(...args);
} catch (e: any) {
throw new ErrnoError(e.errno, 'Out of sync! (' + e.message + ')', args[0] as string, key);
if (e.code != 'ENOENT') throw new ErrnoError(e.errno, 'Out of sync! (' + e.message + ')', args[0] as string, key);
}
return result;
};
Expand Down
7 changes: 1 addition & 6 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,5 @@ export type Concrete<T extends ClassLike> = Pick<T, keyof T> & (new (...args: an
* @internal
*/
export function randomBigInt(): bigint {
try {
return crypto.getRandomValues(new BigUint64Array(1))[0];
} catch {
// fallback
return BigInt('0x' + randomHex(16 /* 4 bits per char */));
}
return BigInt('0x' + randomHex(8));
}

0 comments on commit 3ad0e94

Please sign in to comment.