For Generating SHA1 key in C, I can use :
// The data to be hashed
char data[] = "Hello, world!";
size_t length = sizeof(data);
unsigned char hash[SHA_DIGEST_LENGTH];
SHA1(data, length, hash);
// hash now contains the 20-byte SHA-1 hash
As described here : https://stackoverflow.com/a/9284520/3019006
I want to generate the same key in Java, so that the two keys match if same data is fed. What should I use?