views:

138

answers:

4

I find a algorithm writen by javascript,now i want to convert it to C#, Any tool can do this?

+10  A: 

yeah, the brain tool

user1111111
Hahahahahahahahaha!!! +1 for making me laugh. I was thinking the same thing.
RPM1984
Haha, I was gonna say 'trying using a developer', but this is even better
Jaco Pretorius
+1  A: 

Try using the Keyboard. :)

Javascript isn't that radically different to C# that you need a converter.

How big is this algorithm anyway?

griegs
@griegs: This algorithm is RSA writen by javascript,.NET Framework RSA encryption algorithm depends on whether Win32 Crypto API will have security permissions!
guaike
@guaike: if the code you are working on will be shared with anyone, make sure to document this thoroughly (or consider finding a way to run the .Net algorithms with the correct permissions). I had to spend hours recently decrypting 1000 passwords from someone's homegrown implementation of RSA, and it wasn't pretty. It wasn't that the algorithm they used was bad, but things like character width, encoding, etc. can make maintenance very difficult. "Here be dragons".
Tim
+3  A: 

Well, you could start with Javascript.Net to try your code within another application before rewriting/converting it. Whatever you do, don't rely on auto-generated code for an algorithm of any importance.

If memory serves, there was actually a flavor of JavaScript that ran on the .Net CLR. I don't think it ever caught on.

Tim
For anyone who is curious about JavaScript for .Net: http://www.webreference.com/js/tips/020422.html. Obviously, this is almost a decade old.
Tim
@Time: Javascript.Net is fine,i will try it
guaike
+1  A: 

Using javascript.net or jscript with .net Reflector, will save you brain and keyboard, may be

Andrew Dementiev
I am using jsc.exe compile javascript code to .net dll,and reference this dll in my C# project and call it's method,finally it work for me,thanks!
guaike