T trvip Member Nov 25, 2021 #1 hi how can i convert this js code to b4x? JavaScript: calculateChecksum: function(file, offset, length) { var old = file.seek(offset); var sum = 0; var nlongs = ((length + 3) / 4) | 0; while( nlongs-- ) { sum = (sum + file.getUint32() & 0xffffffff) >>> 0; } file.seek(old); return sum; } thx..
hi how can i convert this js code to b4x? JavaScript: calculateChecksum: function(file, offset, length) { var old = file.seek(offset); var sum = 0; var nlongs = ((length + 3) / 4) | 0; while( nlongs-- ) { sum = (sum + file.getUint32() & 0xffffffff) >>> 0; } file.seek(old); return sum; } thx..
Erel B4X founder Staff member Licensed User Longtime User Nov 25, 2021 #2 Can you upload an input file + parameters and the expected output? Upvote 0