c# - How to convert Csharp code directly in to javascript code -
i newbie in javascript.i want convert function written in c# javascript , same functionality doing in c#. in process came across online converters like duocode,sharpkit,jsil,jsc,script# can did not work. may committing mistake while operating
here c# code want convert javascript function:
public static string decrypt(string data) { var rsa = new rsacryptoserviceprovider(); var dataarray = data.split(new char[] { ',' }); byte[] databyte = new byte[dataarray.length]; (int = 0; < dataarray.length; i++) { databyte[i] = convert.tobyte(dataarray[i]); } rsa.fromxmlstring(_privatekey); var decryptedbyte = rsa.decrypt(databyte, false); return _encoder.getstring(decryptedbyte); }
any suggestions /help appreciated.
what want not possible code have. there ways convert code 1 language another, if code simple enough , not use non-basic external libraries/classes. (i.e. converter can convert loops or other basic logic).
your code not consist of notable logic (except maybe for-each loop), calls external libraries (rsyctypto et al) actual job. in javascript not default libraries, no automated tool can there.
instead google (use use stackoverflow) search code snippet same thing in javascript: encrypt data using rsa in javascript (like rsa encryption javascript , decrypt java).
Comments
Post a Comment