Hybrid-mask: leaner code for supporting --max-length param.