Made masking length configurable.