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

Add deterministic random functions #181

Merged
merged 4 commits into from
Nov 20, 2023
Merged

Add deterministic random functions #181

merged 4 commits into from
Nov 20, 2023

Conversation

jackkleeman
Copy link
Contributor

No description provided.

Copy link
Contributor

@igalshilman igalshilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jackkleeman,
The changes look good to me!
I've one comment about the doc, and about removing the split() which is somewhat premature imho.
Other than that LGTM!

src/restate_context.ts Outdated Show resolved Hide resolved
src/restate_context.ts Outdated Show resolved Hide resolved
this.randstate64 = id
} else {
// hash the invocation ID, which is known to contain 74 bits of entropy
const hash = createHash('sha256')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯


const actual: bigint[] = Array.from(Array(50)).map(() => rand.u64())

// These values were produced with the reference implementation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really great that you've added these!


const actual: bigint[] = Array.from(Array(50)).map(() => rand.u64())

// These values were produced with the reference implementation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really great that you've added these!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants