Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checksum on string

Tags:

Is there a way to calculate a checksum on a string in Linux? The checksum commands that I have seen (cksum, md5sum, sha1sum, etc.) all require a file as input and I do not have a file. I only have a path to a location and want to calculate the checksum on that path.

like image 652
Sharon Avatar asked Aug 28 '11 17:08

Sharon


People also ask

How do you find the checksum of a string?

The checksum should be alphanumeric. The strings are unicode. The strings are actually texts that should be translated and the checksum is stored with each translation (so a translated text can be matched back to the original text). The length of the checksum is not important for me (the shorter, the better)

How do you find the checksum of a string in Java?

Checksum From a String or Byte Array The first thing we need to do is to obtain the input to the checksum algorithm. Here, we are using Java's built-in CRC32 class. Once the class is instantiated, we use the update method to update the Checksum instance with the bytes from the input.

How can I calculate checksum?

To calculate the checksum of an API frame: Add all bytes of the packet, except the start delimiter 0x7E and the length (the second and third bytes). Keep only the lowest 8 bits from the result. Subtract this quantity from 0xFF.


1 Answers

echo -n 'exampleString' | md5sum 

should work.

like image 99
ashiaka Avatar answered Nov 30 '22 06:11

ashiaka