(Just in case, should apply)
If the C code that you posted works with
unsigned values, the C shifRght operator (>>) will NOT bring a '1' to the most significant bit, in case the number to be shifted has its most significant bit set to '1'. Contrarily, it will if the numbers are declared as signed. May be wrong, but I think this is how it worked.
In B4A, the numbers we are using are signed (so it will set the MSb). It has to be taken into account to mimic the C behavior.
If the above is right, taking
@Star-Dust code as a reference and applying it, I think it should be nearer to the final solution
(re-edited)
Public Sub PolyCrc32(buff() as byte, len as int) As Int
Dim Crc As Int = 0
For i=0 To len-1
Crc=Bit.Xor(Crc,buff(i))
For J=0 To 7
' Bit.shiftRight will add a '1' bit to the highest position if the number already has it.
If Bit.And(Crc,1)<>0 Then Crc=Bit.Xor( Bit.And(Bit.ShiftRight(Crc,1), 0x7FFFFFFF) ,0xEDB88320)
Else
Crc=Bit.ShiftRight(Crc,1)
End If
Next
Next
Return crc
End Sub