Line 29: |
Line 29: |
| | | |
| ==== Python 3 ==== | | ==== Python 3 ==== |
− | In Python 3 you can easily calculate pic. Note that the secret and the ppn must be strings. | + | In Python 3 you can easily calculate pic. Note that ''secret'' and the ''ppn'' must be strings. |
| | | |
− | #!/usr/bin/env/python3 | + | #!/usr/bin/env/python3 |
− | secret = "mySecret123!" | + | secret = "mySecret123!" |
− | ppn = "0" | + | ppn = "0" |
− | pic = hashlib.sha256(secret.encode('utf-8')+ppn.encode('utf-8')).hexdigest()[0:4].upper() | + | pic = hashlib.sha256(secret.encode('utf-8')+ppn.encode('utf-8')).hexdigest()[0:4].upper() |
− | print(pic) | + | print(pic) |
| | | |
| == Rationale == | | == Rationale == |