* What used to be called ``id`` in the particle structure is now called ``hash``. This can be used to uniquely identify particles in a simulation. In many cases, one can just identify particles by their position in the particle array, e.g. using ``sim.particles[5]``. However, in cases where particles might get reordered in the particle array (e.g. when using a tree code), when particles can merge (by using the ``collision_resolve_merge`` routine), or when particles get added or removed manually.
* The syntax is as follows:
.. code:: python
sim = rebound.Simulation()
sim.add(m=1)
sim.add(m=1e-3,a=1)
Setting a hash using a string:
sim.particles[1].hash = "planet1"
Finding a particle using a string:
p = sim.get_particle_by_hash("planet1")
Setting a random unique hash:
sim.particles[1].hash = sim.generate_unique_hash()
Save unique hash to find particle later
uhash = sim.particles[1].hash
Find particle using the hash
p = sim.get_particle_by_hash(uhash)