ForHosting KIT · Developer Utilities

Longitudinal redundancy check (LRC)

The nine bytes of 123456789 give the check byte 31 in hexadecimal, 49 in decimal: each byte is combined with exclusive or (XOR), the simplest block parity taught in serial framing and Modbus ASCII lessons. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
123456789
You get
Result
31
Lrc
31
Hex
31
Decimal
49

A longitudinal redundancy check, often abbreviated LRC, is a one-byte integrity trailer formed by exclusive-oring every byte of a message. Serial framing tutorials, industrial protocol primers, and Modbus ASCII classroom labs all introduce LRC as the simplest block parity you can compute by hand: start at zero, XOR the next byte into the accumulator, and after the last byte you hold a single check value that flips if any bit in any byte flips an odd number of times along that bit plane.

What LRC computes and why the XOR check byte matters

Longitudinal redundancy check treats a message as a sequence of eight-bit columns and computes even parity down each column by exclusive-oring successive bytes into an eight-bit register. After the last byte, that register is the LRC: a single check byte usually written as two hexadecimal digits. Unlike a cyclic redundancy check, there is no generator polynomial, no shift table, and no reflection options to misconfigure—only sequential XOR.

That simplicity is why LRC appears in serial block framing lessons and in many descriptions of Modbus ASCII check fields: you can verify a hand calculation on a whiteboard in seconds. This landing always uses the pure XOR definition over the UTF-8 bytes of the submitted text, so multi-byte characters contribute every code-unit byte exactly as an embedded device would if it received the same UTF-8 stream.

The response also echoes the decimal integer, the algorithm label LRC-XOR, the UTF-8 byte count, and the original text so clients can display a full audit line without re-deriving metadata. Because LRC is not collision-resistant and not keyed, treat it as a framing or accidental-corruption check, not as proof of authenticity; prefer CRC-family or SHA-family digests when the search intent moves beyond a one-byte XOR trailer.

Where an LRC calculator earns its keep and how pricing works

Firmware authors and industrial protocol students use a longitudinal redundancy check calculator to verify hand-computed XOR trailers without writing a loop in every language. Teaching platforms and LMS plugins need a deterministic oracle that rejects empty input instead of returning zero for the empty message, so auto-graders can distinguish missing answers from a real check of zero. Content sites ranking for longitudinal redundancy check or LRC calculator benefit from a live tool whose free path matches the paid automation path byte-for-byte on the same pure module.

Validation failures never consume balance after rejection. Pair with CRC-8, CRC-16, or cryptographic hash landings only when the search intent moves beyond an eight-bit XOR framing check—keep this page focused on LRC as XOR of all bytes so SEO intent stays sharp.

Classroom LRC demos

Teachers show the classic digit string check and let students recompute other short strings without installing a protocol library.

What algorithm does this LRC tool use?

Pure sequential XOR of all UTF-8 bytes (LRC-XOR). Start at zero, exclusive-or each byte, keep the low eight bits. The result is one check byte written as lowercase hex.

What happens if the text is empty?

A non-empty string is required; empty input is not treated as a successful zero check.

Is the longitudinal redundancy check calculator free?

The browser tool runs free on your device.

Is LRC the same as CRC-8?

No. LRC here is a simple XOR of all bytes. CRC-8 divides by a polynomial with shift-and-XOR steps. Use the CRC-8 landing when you need poly 0x07; use this page for XOR LRC.

How do I work out an LRC by hand?

Start at zero and XOR each byte of the message into the running value, one after another. After the last byte, that value is the LRC, usually written as two hexadecimal digits; for 123456789 it is 31.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/lrc

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/lrc \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"123456789"}'
{
  "text": "123456789"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.lrc",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Engineers, students, and support teams need that same deterministic hex byte for short payloads without installing a protocol stack or debating CRC polynomials. This longitudinal redundancy check tool accepts non-empty text, encodes it as UTF-8, runs the pure XOR loop, and returns the check byte as two lowercase hexadecimal digits together with the decimal value and a short summary. Empty input is rejected with invalid_input so callers never confuse a missing field with a real zero check.

Input contract, empty-string errors, and the JSON response shape

The string is encoded as UTF-8 before the XOR loop. Pin both a success path and an empty-input error in continuous integration so accidental algorithm changes cannot ship unnoticed. Optional null fields are omitted rather than emitted as null, matching the declarative renderer contract for clean web forms. POST a JSON body with a single required string field named text: any non-empty sequence of characters you want to protect with an LRC. Aliases input, value, s, data, message, and payload are accepted for the same field so SDK stubs and form posts stay flexible. Missing text, a non-string value, or an empty string all fail with invalid_input and a clear message that a non-empty string is required; those failures are not billed on the prepaid API. On success the body includes result, lrc, and hex all set to the same two-digit lowercase hexadecimal check byte; decimal set to the integer zero through two hundred fifty-five; algorithm fixed at LRC-XOR; input_bytes equal to the UTF-8 length; text echoing the input; and message summarizing the byte count and hex result.

Where an LRC calculator earns its keep and how pricing works

Call the free in-browser tool for one-off checks; call the prepaid KIT API from backends, serverless functions, and SDKs when you need a stable contract under balance at $0.002 per successful item. Keep payloads to ordinary text sizes appropriate for a Worker isolate item call; this tool is for short strings and protocol snippets, not multi-megabyte binary blobs.

Serial framing and protocol labs

Verify that a payload string produces the expected one-byte LRC trailer under sequential XOR before comparing device logs or unit-test vectors.

CI fixtures for framing code

Pipelines pin deterministic LRC hex outputs and the empty-input error so accidental algorithm changes fail fast.

How do I compute a longitudinal redundancy check of text?

Send JSON with a non-empty string field text. The API UTF-8-encodes the string, XORs every byte into an eight-bit register, and returns the check byte as two lowercase hex digits in result, lrc, and hex.

Read the full KIT documentation →