Java Code to Node Js or PHP Function
Budget $10-30 USD
- Freelancer
- Jobs
- Java
- Java Code to Node Js or PHP Function
Job Description:
Convert code from java to php or node js equivalent function runnable
Java function
public static byte[] hexStringToBytes(String hexString) {
if (hexString == null || [login to view URL]("")) {
return null;
}
hexString = [login to view URL]();
char[] hexCharacter = [login to view URL]();
for (int i = 0; i < [login to view URL]; i++) {
if (-1 == charToByte(hexCharacter[i])) {
return null;
}
}
int length = [login to view URL]() / 2;
char[] hexChars = [login to view URL]();
byte[] d = new byte[length];
for (int i = 0; i < length; i++) {
int pos = i * 2;
d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
}
return d;
}
public static byte charToByte(char c) {
return (byte) "0123456789ABCDEF".indexOf(c);
}
public static String bytesToHexString(byte[] src){
StringBuilder stringBuilder = new StringBuilder("");
if (src == null || [login to view URL] <= 0) {
return null;
}
for (int i = 0; i < [login to view URL]; i++) {
int v = src[i] & 0xFF;
String hv = [login to view URL](v);
if ([login to view URL]() < 2) {
[login to view URL](0);
}
[login to view URL](hv);
}
return [login to view URL]();
}
public static float signedBytes2Float(byte byHeight, byte byLow)
{
float nTempPointLeft = byHeight;
int nTempPointRight = (byLow & 0xFF);
float fTempPointRight = ((float)nTempPointRight) / 256;
float result;
if (nTempPointLeft < 0)
{
result = nTempPointLeft - fTempPointRight;
}
else
{
result = nTempPointLeft + fTempPointRight;
}
BigDecimal bigTemp = new BigDecimal(result);
return [login to view URL](2, BigDecimal.ROUND_HALF_UP).floatValue();
}
16 freelancers are bidding on average $22 for this job
Hi, I'm an experienced PHP developer. I can convert Java code into PHP. I need some sample input and output values for the following functions: hexStringToBytes bytesToHexString signedBytes2Float If you'd like to dis More
Hello, Thanks for posting. I have rich experience for both of Java and PHP/Node.Js. I offer the fastest job.I hope to work with you. Thanks.
Dear Client. How are you? I am an expert with rich experience in PHP, HTML, Node.js, React, Bootstrap, Express... I'm interested in your website and I'm sure you can get the best results for your needs. I would reall More
Hi, there I have read your job posting very carefully and I understood what you want. I am 4+ years experienced expert of Full Stack React.js and Node.js and its related technologies such as Java Script, AngularJS, Ex More
Hi! Done, finished the conversion of the 4 function to Javascript (Node.js) while going through the code! Can share proof. I come with over a decade of experience with programming, Javascript is just more widely used. More
Hi there, I am a Node.js developer with more than 5 years of experience in developing app with Node.js. I looked at your code carefully and I can write it by Node.js for you.
I'm a final year student who has a experience of almost 5 years on working of the java language. I've also learnt PHP and also done a project on this language. I'm also solving problems on Data Structures and Algorithm More
Hello I am mastering in Java, Node js and PHP. I can help you. I can complete this task for shortest time. Best regards
Dear, sir. I have enough experiences of Java and PHP, Node.js. I've read your code carefully. I am confident about your task. Please keep in touch over the chat. Thanks.
Hi. client. Your project really fits to me. Your code calculates between hex datas. Converting to Node.js or PHP is some more difficult action. I can. Please give me your task. I'll finish your project just in two days More
my experience and work makes me best for this work and to provide you the best output. Rest you will get to know after seeing my work.