if (req.url ~ "^/products/(\d+)(....)") {
  if (re.group.2 != substr(digest.hash_crc32(re.group.1), 0, 4)) {
    error 600;
  } else {
    log "Passed checksum based on CRC32 hash";
  }

  # Also try other fast hash functions!
  log "MD5: " + substr(digest.hash_md5(re.group.1), 0, 4);
  log "CRC32b: " + substr(digest.hash_crc32b(re.group.1), 0, 4);
  log "SHA1: " + substr(digest.hash_sha1(re.group.1), 0, 4);
}