This Java code uses the SHA-1 algorithm to generate a message digest or hash of input text. It imports the necessary classes, defines a method to encrypt a string by applying SHA-1 and returning the hashed output, and includes a main method that tests it on two sample inputs and prints the results.
This Java code uses the SHA-1 algorithm to generate a message digest or hash of input text. It imports the necessary classes, defines a method to encrypt a string by applying SHA-1 and returning the hashed output, and includes a main method that tests it on two sample inputs and prints the results.
This Java code uses the SHA-1 algorithm to generate a message digest or hash of input text. It imports the necessary classes, defines a method to encrypt a string by applying SHA-1 and returning the hashed output, and includes a main method that tests it on two sample inputs and prints the results.