var dM = function (a, b) {
for (var c = 0; c < b.length - 2; c += 3) {
var d = b.charAt(c + 2)
, d = d >= "a" ? d.charCodeAt(0) - 87 : Number(d)
, d = b.charAt(c + 1) == "+" ? a >>> d : a << d;
a = b.charAt(c) == "+" ? a + d & 4294967295 : a ^ d
}
return a
}, fM = function (a) {
for (d = [], e = 0, f = 0; f < a.length; f++) {
var g = a.charCodeAt(f);
128 > g ? d[e++] = g : (2048 > g ? d[e++] = g >> 6 | 192 : (55296 == (g & 64512) && f + 1 < a.length && 56320 == (a.charCodeAt(f + 1) & 64512) ? (g = 65536 + ((g & 1023) << 10) + (a.charCodeAt(++f) & 1023),
d[e++] = g >> 18 | 240,
d[e++] = g >> 12 & 63 | 128) : d[e++] = g >> 12 | 224,
d[e++] = g >> 6 & 63 | 128),
d[e++] = g & 63 | 128)
}
a = 0;
for (e = 0; e < d.length; e++)
a += d[e],
a = dM(a, "+-a^+6");
a = dM(a, "+-3^+b+-f");
0 > a && (a = (a & 2147483647) + 2147483648);
a %= 1E6;
return (a) + "." + (a)
};
希望得出的结果fM("你好")=879267.879267 麻烦各位大神了......
就是像用.NET语言达到和上面一模一样的效果.