Skip to content

Instantly share code, notes, and snippets.

View hfhimage's full-sized avatar

hfhimage hfhimage

View GitHub Profile
@hfhimage
hfhimage / xiami_decode.js
Last active October 12, 2015 23:28 — forked from fanzeyi/xiami_decode.js
Xiami URL Decoder
function decode(loca) {
var result = [], url = "";
var line, rows, extra;
loca = loca.trim();
if(loca === "") {
return "";
}
line = Number(loca[0]);
rows = Math.floor((loca.length - 1) / line);
extra = (loca.length - 1) % line;
@hfhimage
hfhimage / xiami_decode.py
Created November 18, 2012 08:31 — forked from dndx/xiami_decode.py
Xiami URL Decoder
import urllib2
def xiami_decode(s):
s = s.strip()
if not s:
return False
result = []
line = int(s[0])
rows = len(s[1:]) / line
extra = len(s[1:]) % line