MD5加密
2023-01-24 09:16:15 最后更新
s st="iApp一本通"
fn md5.get(st)
ss("md5:" + ss.rnmd5, md5)
syso(md5)
//以下代码放在 md5.myu
//输入字节数组,返回界面变量md5数据
fn bytesget(b)
sl("0;1;2;3;4;5;6;7;8;9;a;b;c;d;e;f", ";", sz)
java(md, null, "java.security.MessageDigest.getInstance", "String", "MD5")
java(a, md, "java.security.MessageDigest.update", "byte[]", b)
java(b2, md, "java.security.MessageDigest.digest")
java(j, null, "java.lang.reflect.Array.getLength", "Object", b2)
//算法
s _md5 = ""
s i = 0
w(j>i)
{
java(ba, null, "java.lang.reflect.Array.get", "Object", b2, "int", i)
java(ba, null, "java.lang.Integer.toBinaryString", "int", ba)
slg(ba, j2)
f(j2<5)
{
s ba2 = "0"
}
else
{
s-(j2, 4, j3)
ssg(ba, 0, j3, ba2)
}
s fst = ""
slg(ba2, j3)
f(j3 > 3)
{
s-(j3, 4, j4)
s-(j3, 3, j5)
ssg(ba2, j4, j5, a)
ss(fst + a, fst)
}
f(j3 > 2)
{
s-(j3, 3, j4)
s-(j3, 2, j5)
ssg(ba2, j4, j5, a)
ss(fst + a, fst)
}
f(j3 > 1)
{
s-(j3, 2, j4)
s-(j3, 1, j5)
ssg(ba2, j4, j5, a)
ss(fst + a, fst)
}
s-(j3, 1, j4)
ssg(ba2, j4, j3, a)
ss(fst + a, fst)
java(fst, null, "java.lang.Integer.valueOf", "String", fst, "int", 2)
java(fst, null, "java.lang.reflect.Array.get", "Object", sz, "int", fst)
ss(_md5 + fst, _md5)
s fst = ""
f(j2 > 3)
{
s-(j2, 4, j4)
s-(j2, 3, j5)
ssg(ba, j4, j5, a)
ss(fst + a, fst)
}
f(j2 > 2)
{
s-(j2, 3, j4)
s-(j2, 2, j5)
ssg(ba, j4, j5, a)
ss(fst + a, fst)
}
f(j2 > 1)
{
s-(j2, 2, j4)
s-(j2, 1, j5)
ssg(ba, j4, j5, a)
ss(fst + a, fst)
}
s-(j2, 1, j4)
ssg(ba, j4, j2, a)
ss(fst + a, fst)
java(fst, null, "java.lang.Integer.valueOf", "String", fst, "int", 2)
java(fst, null, "java.lang.reflect.Array.get", "Object", sz, "int", fst)
ss(_md5 + fst, _md5)
s+(1, i)
}
ss rnmd5 = _md5
end fn
//输入字符串,返回界面变量md5数据
fn get(b)
java(b, b, "java.lang.String.getBytes")
fn md5.bytesget(b)
end fn