;;AUTOLOAD: checksum-string
;;AUTODOC: checksum-string "computes a checksum on a string"
;;(checksum-string string)
;;
;;Computes and returns a simple 32bit checksum which is just the sum of
;;all characters + length of string

(defun checksum-string (s &aux (res (apply + (List s))))
  (if res (+ res (length s)) 0)
)

;;AUTOLOAD: checksum-file
;;AUTODOC: checksum-file "computes a checksum on a file"
;;(checksum-file filename)
;;
;;Computes and returns a simple 32bit checksum which is just the sum of
;;all characters + length of file
;;Triggers an open error if file could not be opened

(defun checksum-file (f)
  (checksum-string (String (open f)))
)
