title: Generate and Verify Voucher Code Using Python
body: <p>I'm working on generating voucher code.
  Current case is:</p>
  
  <ul>
  <li>Voucher is ranging from 0-999, and generated once a week with an unique code for each voucher.</li>
  <li>Can be verified later to check validity.</li>
  <li>There's a secret key for each week, I used the random generated secret key to encrypt the voucher number to code.</li>
  <li><p>I've found out that the code is guessable, for example:</p>
  
  <p>'002' => '\xec\xbe\x98'</p>
  
  <p>'003' => '\xec\xbe\x99'</p></li>
  <li><p>then I tried to use MD5 to hash the code but it's too long(32 digit), and can be time consuming as I wrap the code in a qrcode for the voucher that I generate.</p></li>
  </ul>
  
  <p>currently I'm using pycrypto module with CFB mode AES encryption, </p>
  
  <p>can anyone tell me which is a preferred method to generate a verifiable voucher code ?</p>