aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/md5sum.ml
blob: d6cac937764a71709b61231c2e6d589f61c52577 (plain)
1
2
3
4
5
6
7
8
9
10
let () =
  match Sys.argv with
  | [|_; file|] ->
      let md5 = Digest.to_hex (Digest.file file) in
      print_endline (md5 ^ "  " ^ file)
  | _ ->
      prerr_endline "Error: This program needs exactly one parameter.";
      prerr_endline "Usage: ocaml md5sum.ml [FILE]";
      prerr_endline "Print MD5 (128-bit) checksum.";
      exit 1