Questions tagged [checksum]

A checksum is a small chunk of data calculated from another larger piece of data, used to detect any transmission errors in the data. Use this tag for questions related to calculating or verifying checksums. (See also hashing)

Filter by
Sorted by
Tagged with
56
votes
57answers
8k views

The Luhn algorithm for verifying credit card numbers, etc

Challenge Write the shortest program or function to calculate the Luhn Algorithm for verifying (credit card) numbers. Luhn algorithm explained From RosettaCode, this algorithm for the purposes of ...
21
votes
19answers
2k views

For what block sizes is this checksum valid?

The input: As an example, take a list containing a number of bits (in this case, 32): 11000010000100111011000011001011 We can calculate a simple checksum of this ...
36
votes
59answers
6k views

Is my barcode valid?

An EAN-8 barcode includes 7 digits of information and an 8th checksum digit. The checksum is calculated by multiplying the digits by 3 and 1 alternately, adding the results, and subtracting from the ...
30
votes
49answers
6k views

Calculate ISBN-13 check digit

Write a function which, given the first 12 digits of an ISBN-13 code, will calculate the entire ISBN via calculating and appending an appropriate check digit. Your function's input is a string ...
14
votes
12answers
898 views

Compute the Redwolf Checksum™ of some data

I will preface this by saying that I made this for fun; I have absolutely no formal knowledge on cryptography or error correction. Do not use this algorithm in anything remotely important. I was kind ...
32
votes
38answers
5k views

Compute the Adler-32 checksum

Background Adler-32 is a 32-bit checksum invented by Mark Adler in 1995 which is part of the widely used zlib library (also developed by Adler). Adler-32 is not as reliable as a 32-bit cyclic ...
21
votes
22answers
4k views

Converting ISBN-13 to ISBN-10

Introduction In this challenge your task is to generate the ISBN-10 code for books given its ISBN-13 code, assuming that such a code exists. Such an ISBN-13 code consists of several parts separated ...
19
votes
23answers
5k views

Generate a parity bit

A parity bit, is one of the simplest forms of a checksum. First, you have to pick the parity, even or odd. Let's say we pick even. Now, we need a message to transmit. Let's say our message is "...