fix the checksum() function for crypto API of node > v.10