Skip to content

Conversation

kjelko
Copy link
Contributor

@kjelko kjelko commented Nov 5, 2024

Update remote config condition evaluation hashing

@lahirumaramba lahirumaramba changed the title Update remote config condition evaluation hashing change(rc): Update Remote Config condition evaluation hashing Nov 5, 2024
@lahirumaramba lahirumaramba added release-note release:stage Stage a release candidate labels Nov 5, 2024
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

}

return hash64;
const hex = createHash('sha256').update(seededRandomizationId).digest('hex');
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking (no action req'd): we had a 64 bits hash before, so we don't need 256 bits, but sha256 is broadly available and there's no noticeable performance difference, so sha256 is fine.


// Manually negate the hash if its value is less than 0, since Math.abs doesn't
// support BigInt.
if (hash64 < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking (no action req'd): we're now directly instantiating the bigint with the hash, rather than coercing it to behave like a 64bit signed Java long, so it will always be positive.

@kjelko kjelko merged commit 4babb45 into master Nov 7, 2024
8 checks passed
@lahirumaramba lahirumaramba deleted the ssrc-hash branch November 7, 2024 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:stage Stage a release candidate release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants