The Hammer product is Endurolytes. I and many other LD riders use them. They're an electrolyte cap. Not specific for cramp prevention, rather something to take steadily all during the ride to maintain electrolyte levels. Almost all cramping during athletic events is due to undertraining. So the best cramp prevention is to train hard and long, especially the upper end, at LT and above, even though that's not where you'll be riding during an LD event. Stoker and I did 1:12 in Zone 4 and 8 minutes is Zone 5 on our 47 mile ride on Sunday. A short but intense ride.
The offered Hammer product on your event ride was probably HEED, which is a sport drink containing electrolytes. Though promoted as a cramp preventative, it probably doesn't do that, but it does maintain electrolyte and hydration levels on a ride.
To ease a cramp once one has started, the only reliable thing IME is Tums Regular Strength. They work very fast. After a ride, I always take a 500/250 cal/mag cap. That prevents post-ride cramps.