Whenever the board of health of any city or county, or the board of supervisors of any county, or the county physician of any county of this State, presents, or causes to be presented to the sheriff, or other officer having charge of any county jail or prison in any county or city, in this State, a certificate, or order, in writing, to the effect that it is by them, or him, considered necessary for the purpose of protecting the public health, or to prevent the introduction or spreading of disease, or to protect or improve the health of criminals under sentence, that the hair of any criminal or criminals be cut, such sheriff, or other officer, must cut, or cause to be cut, the hair of any such person or persons in his charge convicted of a misdemeanor and sentenced to a longer term of imprisonment than 15 days, to a uniform length of one and one-half inches from the scalp of such person or persons so imprisoned.
Ca. Pen. Code § 4020