Constant time check for codes