Quantcast
Channel: Riff Blog - Surfing the dataverse, to the sound of music
Viewing all articles
Browse latest Browse all 79

Golang tip of the day; PHP-compatible crc32

$
0
0

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:

read more


Viewing all articles
Browse latest Browse all 79

Trending Articles