Skip to content

Instantly share code, notes, and snippets.

@radekg
Last active December 17, 2015 21:59
Show Gist options
  • Select an option

  • Save radekg/5679053 to your computer and use it in GitHub Desktop.

Select an option

Save radekg/5679053 to your computer and use it in GitHub Desktop.
Generate Cassandra tokens in Ruby.
nodes = 5
for x in Range.new(0,nodes,false)
token = 2 ** 127 / nodes * x
puts "Initial token: #{token}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment