You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to determine the pubsub topic to use for a content topic in the context of autosharding, we need to map the content topic to a shard number using the following algorithm: https://rfc.vac.dev/spec/51//#algorithm
Proposed Solutions
Add a function to utils, which, given a string and number of shards:
validates that the string is a valid content topic
parses application and version fields from the string
SHA-256 hash the concatenation of the UTF-8 string bytes of the application and version fields
perform hash mod numShards to determine which shard index to use
Notes
only use the last 64 bits of the hash when performing modulo step
The text was updated successfully, but these errors were encountered:
This is a feature request
Problem
In order to determine the pubsub topic to use for a content topic in the context of autosharding, we need to map the content topic to a shard number using the following algorithm: https://rfc.vac.dev/spec/51//#algorithm
Proposed Solutions
Add a function to utils, which, given a string and number of shards:
hash
modnumShards
to determine which shard index to useNotes
only use the last 64 bits of the hash when performing modulo step
The text was updated successfully, but these errors were encountered: