It mostly depends on the girl. If shes the awkward type that just raps her arms around you because you want a hug, then don't bother. Just look happy when you see her, smile and put your arms out for a hug :)
Well I guess some of the above girls disagree with me but I think it's kind of pathetic for a guy to ask for a hug. If it feels right just do it. If she twists away from you don't ever mention it or try it again. It's fine for a girl or woman to ask though.