Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Devaka Cooray
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Jeanne Boyarsky
Tim Cooke
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Bartenders:
Forum:
Beginning Java
CRC in java
Paul Mackie
Greenhorn
Posts: 2
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm doing an university project on sending files over a network and I need to get a CRC from a
string
of text. I was wondering if anyone out there can help me with this
Thanks
Carl Trusiak
Sheriff
Posts: 3341
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Using the CRC32 class is one way.
import java.util.zip.CRC32; public class CrcTest { public static void main(String[] arg) { CRC32 crc = new CRC32(); String s = "Now is the time for \nall good men to come to the aid\nof their county"; crc.update(s.getBytes()); System.out.println(s); System.out.println(crc.getValue()); } }
Hope This Helps
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Paul Mackie
Greenhorn
Posts: 2
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks. I didn't know such a class existed
Create symphonies in seed and soil. For this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Java Security
CRC for a file
CRC16 with Polynominal : 0x8408, and Preset CRC : 0x6363
CRC-32
New type of Error??
More...