| 54 | // |
| 55 | |
| 56 | ssize_t // O - Size of hash or -1 on error |
| 57 | cupsHashData(const char *algorithm, // I - Algorithm name |
| 58 | const void *data, // I - Data to hash |
| 59 | size_t datalen, // I - Length of data to hash |
| 60 | unsigned char *hash, // I - Hash buffer |
| 61 | size_t hashsize) // I - Size of hash buffer |
| 62 | { |
| 63 | if (!algorithm || !data || datalen == 0 || !hash || hashsize == 0) |
| 64 | { |
| 65 | _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad arguments to function"), 1); |
| 66 | return (-1); |
| 67 | } |
| 68 | |
| 69 | return (hash_data(algorithm, hash, hashsize, data, datalen, NULL, 0)); |
| 70 | } |
| 71 | |
| 72 | |
| 73 | // |
no test coverage detected