Find Jobs
Hire Freelancers

Rewrite short JavaScript in PHP

$10-30 USD

In Progress
Posted about 5 years ago

$10-30 USD

Paid on delivery
I need a quick function rewrite from JavaScript to PHP. It has to work the same, i.e. produce the same result! If you know both of these languages, this is a fast job for you. Here's the JS script: function divisible(hash, mod) { // We will read in 4 hex at a time, but the first chunk might be a bit smaller // So ABCDEFGHIJ should be chunked like AB CDEF GHIJ var val = 0; var o = [login to view URL] % 4; for (var i = o > 0 ? o - 4 : 0; i < [login to view URL]; i += 4) { val = ((val << 16) + parseInt([login to view URL](i, i+4), 16)) % mod; } return val === 0; } var serverSeed = '70d3c5c1df37d4e728e0c904adde41420cf50a4a39e7fee9fc2d84c753679170'; var clientSeed = '0xd8b8a187d5865a733680b4bf4d612afec9c6829285d77f438cd70695fb946801'; crashPointFromHash = function(serverSeed) { var hash = [login to view URL]('sha256', serverSeed).update(clientSeed).digest('hex'); // In 1 of 101 games the game crashes instantly. if (divisible(hash, 101)) return 0; // Use the most significant 52-bit from the hash to calculate the crash point var h = parseInt([login to view URL](0,52/4),16); var e = [login to view URL](2,52); return [login to view URL]((100 * e - h) / (e - h)); };
Project ID: 18843891

About the project

2 proposals
Remote project
Active 5 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
2 freelancers are bidding on average $25 USD for this job
User Avatar
Hello, I can convert javascript code to php as per your requirements. I have 5+ years experience of web development. Thanks Mahesh
$20 USD in 1 day
4.9 (31 reviews)
5.5
5.5
User Avatar
i have experience with working on both languages,solving problems and making projects.i will do it within a day.
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of POLAND
Szczecin, Poland
3.7
25
Payment method verified
Member since Sep 6, 2004

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.