nathforge/pyotp — pull request #7 by gsbabil (2014-10-16 03:09:17+00:00)
Title: Fixes buggy shorter token generation

Details:

According to [RFC 6238](http://tools.ietf.org/html/rfc6238), OTP tokens shorter
than 6 digits should be padded with `0` on the left in order to become 6 digits.
As a demonstration, the following code will produce a 5 digit token `41267` in
commit `5616a8d7d8db901582c4953f62b46e13a3d65588` while the token
should really be `041267`. This patch fixes the issue.

```
>>> import pyotp
>>> print pyotp.HOTP('KEHY3WFC7IGYK6Z3').at(int(1413252660/30))
041267
```