123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140moduleT=structincludeBin_prot.Md5letsexp_of_tt=t|>to_hex|>String.sexp_of_tlett_of_sexps=s|>String.t_of_sexp|>of_hex_exnlett_sexp_grammar=Sexplib.Sexp_grammar.coerceString.t_sexp_grammarendlethash_fold_taccumt=String.hash_fold_taccum(T.to_binaryt)lethasht=String.hash(T.to_binaryt)moduleAs_binary_string=structmoduleStable=structmoduleV1=structtypet=T.t[@@derivingcompare]lethash_fold_t=hash_fold_tlethash=hashletsexp_of_tx=String.sexp_of_t(T.to_binaryx)lett_of_sexpx=T.of_binary_exn(String.t_of_sexpx)lett_sexp_grammar=Sexplib.Sexp_grammar.coerceString.t_sexp_grammarincludeBin_prot.Utils.Make_binable_without_uuid[@alert"-legacy"](structmoduleBinable=Stringtypet=Bin_prot.Md5.tletto_binable=T.to_binaryletof_binable=T.of_binary_exnend)endendincludeStable.V1includeComparable.Make(Stable.V1)includeHashable.Make(Stable.V1)endmoduleStable=structmoduleV1=structtypet=T.t[@@derivingcompare,sexp,sexp_grammar]lethash_fold_t=hash_fold_tlethash=hashincludeBin_prot.Utils.Make_binable_without_uuid[@alert"-legacy"](structmoduleBinable=Bin_prot.Md5typet=Bin_prot.Md5.tletto_binable=Fn.idletof_binable=Fn.idend)endletdigest_strings=Md5_lib.stringsendincludeStable.V1includeComparable.Make(Stable.V1)includeHashable.Make(Stable.V1)letdigest_num_bytes=16letto_hex=T.to_hexletfrom_hex=T.of_hex_exnletof_hex_exn=T.of_hex_exnletof_binary_exn=T.of_binary_exnletto_binary=T.to_binaryletdigest_string=Stable.digest_stringletdigest_bytes=Md5_lib.bytesexternalcaml_sys_open:string->Caml.open_flaglist->perm:int->int="caml_sys_open"externalcaml_sys_close:int->unit="caml_sys_close"externaldigest_fd_blocking:int->string="core_md5_fd"letdigest_file_blockingpath=of_binary_exn(Base.Exn.protectx(caml_sys_openpath[Open_rdonly;Open_binary]~perm:0o000)~f:digest_fd_blocking~finally:caml_sys_close);;letfile=digest_file_blockingletdigest_channel_blocking_without_releasing_runtime_lockchannel~len=of_binary_exn(Caml.Digest.channelchannellen);;letchannelchannellen=digest_channel_blocking_without_releasing_runtime_lockchannel~len;;letoutput_blockingtoc=Caml.Digest.outputoc(to_binaryt)letoutputoct=output_blockingtocletinput_blockingic=of_binary_exn(Caml.Digest.inputic)letinput=input_blockingletdigest_subbytes=Md5_lib.subbytesletstring=digest_stringletbytes=digest_bytesletsubbytessposlen=digest_subbytess~pos~lenletdigest_bin_protwritervalue=digest_string(Core_bin_prot.Writer.to_stringwritervalue);;externalc_digest_subbigstring:Bigstring.t->pos:int->len:int->res:Bytes.t->unit="core_md5_digest_subbigstring"letunsafe_digest_subbigstringbuf~pos~len=(* It's more efficient to allocate the result on the OCaml side and declare the C
function as noalloc than to let the C function allocate. *)letres=Bytes.create16inc_digest_subbigstringbuf~pos~len~res;Md5_lib.unsafe_of_binary(Bytes.unsafe_to_string~no_mutation_while_string_reachable:res);;letdigest_subbigstringbuf~pos~len=Ordered_collection_common.check_pos_len_exn~pos~len~total_length:(Bigstring.lengthbuf);unsafe_digest_subbigstringbuf~pos~len;;letdigest_bigstringbuf=unsafe_digest_subbigstringbuf~pos:0~len:(Bigstring.lengthbuf);;