Closed

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();

}

Skills: Java, JavaScript, PHP, Software Architecture, Node.js

About the Client:
( 1 review ) Lucknow, India

Project ID: #35432736

16 freelancers are bidding on average $22 for this job

kanwalrafique

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

$20 USD in 1 day
(74 Reviews)
6.5
benkushau

Hello, I Develop PHP Websites from scratch or Customize the existing one or Fix errors for your current website in Laravel, CodeIgniter, WordPress, Ecommerce, Core PHP. What Do I Offer? PHP Scripting Front End De More

$20 USD in 7 days
(26 Reviews)
5.9
Suptechy

Hello there. I will not write a long paragraph to inspire you. Just want to inform you that I have a huge background in this niche. I can advise you on everything from start to end in your case. I can complete the pro More

$35 USD in 4 days
(8 Reviews)
5.0
mmarkusschuster7

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.

$20 USD in 7 days
(4 Reviews)
5.0
denorzahar

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

$20 USD in 7 days
(11 Reviews)
4.2
lokeshkumar96

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

$20 USD in 7 days
(19 Reviews)
4.1
rolandkontson

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

$20 USD in 5 days
(11 Reviews)
3.8
mohammadtss

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.

$15 USD in 1 day
(1 Review)
1.7
payalsharma01

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

$20 USD in 7 days
(0 Reviews)
0.0
jeremyhahamed

Hello I am mastering in Java, Node js and PHP. I can help you. I can complete this task for shortest time. Best regards

$20 USD in 1 day
(0 Reviews)
0.0
GarbSergei

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.

$30 USD in 2 days
(0 Reviews)
0.0
SlunkAlxandr

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

$20 USD in 7 days
(0 Reviews)
0.0
AtulGarg28

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.

$21 USD in 6 days
(0 Reviews)
0.0
Kongvanna

Hello, your code is much related with string. I have rich experience in java and string processing. As a full stack developer with 6 years of experience, I have extensive experience in PHP, JavaScript/TypeScript, Aja More

$25 USD in 1 day
(0 Reviews)
0.0