CRC-32: Difference between revisions
Content added Content deleted
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
|||
Line 1,197: | Line 1,197: | ||
=={{header|Java}}== |
=={{header|Java}}== |
||
<syntaxhighlight lang=Java> |
<syntaxhighlight lang=Java> |
||
import java.util.zip.CRC32; |
|||
⚫ | |||
public class CRCMaker { |
|||
<syntaxhighlight lang=Java> |
|||
public static void main(String[] args) throws IOException { |
|||
String string = "The quick brown fox jumps over the lazy dog"; |
|||
CRC32 crc = new CRC32(); |
|||
crc.update(string.getBytes()); |
|||
System.out.println( "The CRC-32 value is : " + Long.toHexString( myCRC.getValue( ) ) + " !" ) ; |
|||
System.out.printf("%x", crc.getValue()); |
|||
} |
|||
} |
|||
⚫ | |||
</syntaxhighlight> |
|||
{{out}} |
{{out}} |
||
<pre> |
|||
<pre>The CRC-32 value is : 414fa339 !</pre> |
|||
414fa339 |
|||
</pre> |
|||
=={{header|JavaScript}}== |
=={{header|JavaScript}}== |