Revision: 1945
          http://svn.sourceforge.net/vexi/?rev=1945&view=rev
Author:   mkpg2
Date:     2007-07-08 09:08:10 -0700 (Sun, 08 Jul 2007)

Log Message:
-----------
Forward porting feature. Restoring md5 hash function.

Modified Paths:
--------------
    core/trunk/org.vexi.core/src/org/vexi/core/Vexi.jpp

Modified: core/trunk/org.vexi.core/src/org/vexi/core/Vexi.jpp
===================================================================
--- core/trunk/org.vexi.core/src/org/vexi/core/Vexi.jpp 2007-07-08 16:05:08 UTC 
(rev 1944)
+++ core/trunk/org.vexi.core/src/org/vexi/core/Vexi.jpp 2007-07-08 16:08:10 UTC 
(rev 1945)
@@ -9,6 +9,7 @@
 import java.io.InputStreamReader;
 import java.io.InputStream;
 
+import org.ibex.crypto.MD5;
 import org.ibex.js.Fountain;
 import org.ibex.js.JS;
 import org.ibex.js.JSDate;
@@ -20,6 +21,7 @@
 import org.ibex.js.XMLRPC;
 import org.ibex.util.Cache;
 import org.ibex.util.Callable;
+import org.ibex.util.Encode;
 import org.ibex.util.InputStreamToByteArray;
 import org.ibex.util.Log;
 import org.ibex.util.Pausable;
@@ -114,6 +116,7 @@
            case "net.rpc": return getSub(name);
            case "net.rpc.soap": return METHOD;
            case "net.rpc.xml": return METHOD;
+           case "params": return Main.params;
            case "regexp": return METHOD;
            case "stream": return getSub(name);
            case "stream.homedir": return Resources.fountainForName("file:" + 
System.getProperty("user.home"));
@@ -217,7 +220,13 @@
                            if(args[0] == null) throw new JSExn("can't clone 
the null value");
                            return new JS.Clone(args[0]);
                        case "crypto.rsa": /* FEATURE */ return null;
-                       case "crypto.md5": /* FEATURE */ return null;
+                       case "crypto.md5":
+                           byte[] content = JSU.toString(args[0]).getBytes();
+                           MD5 md5 = new MD5();
+                           md5.update(content, 0, content.length);
+                           byte[] data = new byte[md5.getDigestSize()];
+                           md5.doFinal(data, 0);
+                           return JSU.S(Encode.bytesToHex(data).toLowerCase());
                        case "crypto.sha1": /* FEATURE */ return null;
                        case "crypto.rc4": /* FEATURE */ return null;
                        case "file.remove": ((Fountain.File)args[0]).remove(); 
return null;  


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to