I used to work from 7-4 and had to walk to the bus stop at 5:15am. It was so dark and scary that early in the morning in winter time. It happened one day there was a guy with a hoodie walked down from a athletic field. I was so scared. Since then I'd just walk on the road, not on the sidewalk as there weren't a single car on the road. My co-worker suggested me to hold the keys in my hand as a weapon. I worked this shift for 4 months and due to the safety issue I talked to my boss and requested to work a later shift and he agreed.
i get off at 7pm...so i usually carry a long umbrella (with a pointy stem at the bottom) and swing it back and forth while i walk to my car....so hopefully i won't be an easy target...
You have to make sure you are strong enough that they won't easily over-power you. If they can easily grab the pepper spray (or any other weapon) from you, they will use it on you.
If you are a tiny girl, i don't suggest carrying/using any weapons, instead, get something that get noticed might help. Get yourself a whistle, and wear a bike flashing light on your bag at night.
If the public can easily notice you, you will be much safer.