Y'all, don't go anywhere without some means of self-defense. A pocket stun gun costs $20, or if you live in a country where they're banned, carry a pocket corkscrew with a foil cutter on the end.
Stun guns, while potentially being intimidating to a lone attacker, are surprisingly ineffective if actually used for defense.
Pepper spray, specifically the type that uses a stream instead of a fine mist, is far more effective at stopping an attack and giving an opportunity to escape.
I recommend POM pepper spray, personally. The smaller versions are 50 state legal.
Yeah I've been hit by a few stun guns, but not the police kind. It hurts sure and it makes a scary noise, but if I were intent on violence they would not stop me.
Two rolls of quarters are entirely legal to carry, and act as makeshift brass knuckles in a pinch. The additional mass will make you break your knuckles, but you'll be shattering their bones as well.
Shattering your knuckles sounds like a bad idea, especially if your initial defense does not incapacitate your attacker, as it may render you unable to continue to fight back.
As Despoticruin mentioned, a 'tactical' style flashlight or pen would be better options, and you can temporarily blind or disorient the attacker(s) with a flashlight as they close the distance.
Should be mentioned any close-in physical defense like that should be a last resort tactic if you cannot escape, and in those situations, a defender would massively benefit from being physically fit and somewhat knowledgeable on how to fight, preferably from classes where you learn to both dish out and take a punch.
Even then, those tools won't give you much of an edge if you're outnumbered. Pepper spray is still the best non-lethal option for areas that allow you to carry it.
If you go this route then hammer, don't punch. I hear that those small steel flashlights with the castellated heads are perfect for exactly that kind of swing.
Fitspacks are always a bad idea. If you want something legal to carry, start keeping your keys on a locking carbiner rated for rock climbing. If it has a kilonewton (kN) rating stamped in it, it is suitable. This won't collapse on your hand and no amount of force any human is capable of generating will break it, but anyone whose nose you drive it into at maximum effort is likely to remember the experience. This should also be legal to carry anywhere.