Rewrite short JavaScript in PHP

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


Skills: AJAX, Javascript, jQuery / Prototype, PHP, Software Architecture

See more: how to change url using htaccess in php, url rewriting in php using .htaccess example, url rewrite examples, url rewriting in php w3schools, url rewriting for dynamic pages php, javascript redirect on page load, htaccess routing, php url rewrite without htaccess, using javascript php, rewrite javascript php, i am php developer in chandigarh, i need php developer in chennai, i want php developer in bhopal, learn web development php javascript html css in your spare time and earn money in the process hatfield, where can i hire php developers in cape town, script type text javascript src http cleanfiles net js w php i 36568q5bas script, i need a php developer in gauteng south africa, i need a php developer in south africa, i need php developer in kolkata, i want php developers in coimbatore

About the Employer:
( 24 reviews ) Szczecin, Poland

Project ID: #18843891

Awarded to:


Hello, I am very interested to your project. I have over 15 years of experiences in developing websites and app. Briefly I am a versatile and relevant with all project. If you want me, please let me know. Perhaps More

$15 USD in 1 day
(1 Review)

4 freelancers are bidding on average $24 for this job


Nice to meet you. I have good skills about Web development. I can finish your project nicely. Please contact me. Thank you very much.

$30 USD in 1 day
(55 Reviews)

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
(23 Reviews)

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 Reviews)