Skip to content

Commit

Permalink
xor filter #29
Browse files Browse the repository at this point in the history
  • Loading branch information
folkvir committed Dec 30, 2021
1 parent 6ad96c9 commit 3d4d57e
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 165 deletions.
10 changes: 9 additions & 1 deletion src/base-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import seedrandom from 'seedrandom'
*/
export default abstract class BaseFilter {
private _seed: number
private _rng: () => number
private _rng: any

constructor() {
this._seed = utils.getDefaultSeed()
Expand Down Expand Up @@ -65,6 +65,14 @@ export default abstract class BaseFilter {
return this._rng
}

/**
* Return a next random seeded int32 integer
* @returns
*/
nextInt32(): number {
return this._rng.int32()
}

/**
* Save the current structure as a JSON object
*/
Expand Down
Loading

0 comments on commit 3d4d57e

Please sign in to comment.