Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

370 B
Raw Blame
import { createHash } from 'node:crypto'

// A host's stable 0-99 bucket: a cohort of N percent is the hosts below N.
export function hostCohortBucket(identity: { userId: string; relayHostId: string }): number {
  return (
    createHash('sha256')
      .update(JSON.stringify([identity.userId, identity.relayHostId]))
      .digest()
      .readUInt32BE(0) % 100
  )
}