Coagulants for Tofu or else
To add to @moscafj's answer:

There is a saying "There's no such thing as poison, there's only dose". If you take too much of anything, it can be hazardous to your health or wellbeing. Your body needs both calcium and magnesium to function properly, but taking too much can cause you issues as well. 

Calcium chloride and magnesium chloride can cause burns if ingested as a solid,or if touched with wet hands while in the powder form, as well as "gastric distress, and vomiting". These mostly taste like ordinary table salt (sodium chloride), and calcium chloride is often used to replace the sodium in "low sodium" foods. These salts are hygroscopic and will absorb water from the air rapidly unless kept tightly sealed.

Magnesium sulfate is used to treat a range of health problems, including constipation, but too much can also result in hypocalcaemia (low blood calcium) and resulting depression of heart function. MgSO4 is also bitter and unpalatable, but that doesn't stop people drinking it.

The chemical forms of these various compounds don't matter at all unless you happen to be into chemistry and are working out something quantitative in terms of molecular amounts or Moles as they are known. If you see a term containing the word hydrate, this means water of crystallization, which is a chemistry term for the naturally occurring amount of water that is found in the crystalline form. The exact number of water molecules associated with each molecule of the chemical is indicated by the prefix, which might be mono (1), di (2), or a number of other prefixes and varies according to the chemical and which forms it can take. For cooking purposes the hydrate form is the same as anhydrous (without water), though the anhydrous is often more expensive and will usually absorb water from the air rapidly to form the hydrate.