C implementation of adler algo