Jump to content

CRC-32: Difference between revisions

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

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.