2022 Developer Survey is open! Take survey.

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
14 votes
12 answers

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 ...
user avatar
22 votes
19 answers

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 ...
user avatar
21 votes
22 answers

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 ...
user avatar
  • 16.3k
36 votes
59 answers

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 ...
user avatar
  • 13.9k
32 votes
38 answers

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 ...
user avatar
  • 206k
19 votes
23 answers

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 "...
user avatar
30 votes
49 answers

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 ...
user avatar
57 votes
57 answers

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 ...
user avatar