This function calculates the SHA-1 checksum of a buffer. The function allocates the context, performs the calculation, and frees the context. The SHA-1 result is calculated as output = SHA-1(input buffer). \warning SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.