Search this website. Cocaine metabolism has been discussed multiple times.
And it does stay in the hair for a long time.
I've been told that as long as you haven't cut off the part of the hair that was present or produced around the time the cocaine was used, you can pick up the metabolites. I'm not a 100% sure this is true though, especially when you figure in the chemicals that people use on their hair, and if the primary cocaine metabolite isn't light stable then it would degrade when you stood in the sun.