Golang tip of the day; PHP-compatible crc32
While porting (well, actually rewriting) an old PHP library to Go, I had to use a CRC (cyclic redundancy check) on a buffer. In old-school PHP, the standard is well established since PHP 4: just use crc32
from the strings
package, and beware of the sign bit or, to be a bit more current while still compatible, use the hash()
function from the hash
package, like this example: