util_md5.inc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. { Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. }
  16. {
  17. * @package Apache MD5 library
  18. }
  19. //#include "apr_md5.h"
  20. {
  21. * Create an MD5 checksum of a given string
  22. * @param a Pool to allocate out of
  23. * @param string String to get the checksum of
  24. * @return The checksum
  25. * @deffunc char *ap_md5(apr_pool_t *a, const unsigned char *string)
  26. }
  27. function ap_md5(p: Papr_pool_t; const string_: PChar): PChar;
  28. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  29. external LibHTTPD name LibNamePrefix + 'ap_md5' + LibSuff8;
  30. {
  31. * Create an MD5 checksum of a string of binary data
  32. * @param a Pool to allocate out of
  33. * @param buf Buffer to generate checksum for
  34. * @param len The length of the buffer
  35. * @return The checksum
  36. * @deffunc char *ap_md5_binary(apr_pool_t *a, const unsigned char *buf, int len)
  37. }
  38. function ap_md5_binary(a: Papr_pool_t; const buf: PChar; len: Integer): PChar;
  39. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  40. external LibHTTPD name LibNamePrefix + 'ap_md5_binary' + LibSuff12;
  41. {
  42. * Convert an MD5 checksum into a base64 encoding
  43. * @param p The pool to allocate out of
  44. * @param context The context to convert
  45. * @return The converted encoding
  46. * @deffunc char *ap_md5contextTo64(apr_pool_t *p, apr_md5_ctx_t *context)
  47. }
  48. function ap_md5contextTo64(a: Papr_pool_t; context: Papr_md5_ctx_t): PChar;
  49. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  50. external LibHTTPD name LibNamePrefix + 'ap_md5contextTo64' + LibSuff8;
  51. {
  52. * Create an MD5 Digest for a given file
  53. * @param p The pool to allocate out of
  54. * @param infile The file to create the digest for
  55. * @deffunc char *ap_md5digest(apr_pool_t *p, apr_file_t *infile)
  56. }
  57. function ap_md5digest(p: Papr_pool_t; infile: Papr_file_t): PChar;
  58. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  59. external LibHTTPD name LibNamePrefix + 'ap_md5digest' + LibSuff8;