Skip to content

Instantly share code, notes, and snippets.

@mrluanma
mrluanma / base62.py
Created July 15, 2013 14:34
新浪微博mid转id Python代码。
import sys
ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
def rsplit(s, count):
f = lambda x: x > 0 and x or 0
return [s[f(i - count):i] for i in range(len(s), 0, -count)]