CaculateCodeNum