Update README.md
parent
628efbb377
commit
1657d2fdae
|
@ -134,10 +134,9 @@ To generate the unique url, we could:
|
||||||
def base_encode(num, base=62):
|
def base_encode(num, base=62):
|
||||||
digits = []
|
digits = []
|
||||||
while num > 0:
|
while num > 0:
|
||||||
remainder = num % base
|
num, remainder = divmod(num, base)
|
||||||
digits.append(remainder)
|
digits.append(remainder)
|
||||||
num = num // base
|
digits.reverse()
|
||||||
digits = digits.reverse()
|
|
||||||
return digits
|
return digits
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue