Returns a short string hash for a given int.
(i, base="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")
| 89 | encode_utf8 = encode_string |
| 90 | |
| 91 | def shi(i, base="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"): |
| 92 | """ Returns a short string hash for a given int. |
| 93 | """ |
| 94 | s = [] |
| 95 | while i > 0: |
| 96 | i, r = divmod(i, len(base)) |
| 97 | s.append(base[r]) |
| 98 | return "".join(reversed(s)) |
| 99 | |
| 100 | #--- LIST FUNCTIONS -------------------------------------------------------------------------------- |
| 101 |
no test coverage detected