During the Second World War, all inmates admitted to any kind of camp of the Third Reich had to have their hair shorn and kept trim during the entire time of their incarceration. Exceptions were granted only in special cases. This is graphically demonstrated by the so-called Auschwitz Album showing shorn male and female inmates after their admission into the camp.
This life-saving procedure, considered humiliating for many women, became necessary due to the persistent presence and spread of lice in the German war-time camps. Lice glue their eggs (nits) onto human hair, thus vitiating attempts at eradicating them by merely disinfesting clothes and washing the inmates.
During the war, most everything was recycled and reused in Germany, as the country was increasingly cut off from any foreign supplies. Hair was no exception. From a certain length onward, hair was collected and submitted to various companies specializing in turning them into industrial products. Before such hair was sent out, it had to be disinfested to make sure no lice and nits were spread with it, and thus potentially typhus, which is transmitted by lice.
There is no evidence that hair found at Auschwitz or elsewhere upon capture by Allied armies originated from inmates who had been gassed. Even if chemical analysis showed the presence of cyanide resulting from the exposure to Zyklon B (hydrogen cyanide), this merely proves that the hair was disinfested before getting bagged and stored, but not that it was exposed to hydrogen-cyanide gas while still on the head of an inmate.