Ir para o conteúdo
Number Buffet

Números de pedido

Monte referências de pedido a partir de um padrão, com um embaralhamento opcional que as mantém únicas sem torná-las consecutivas.

4 min de leitura

Configurações

Predefinições rápidas

Fields: {SEQ:6} zero-padded counter, {YYYY} and {YY} year, {MM} month, {DD} day, {Q} quarter, {N:4} random digits, {A:3} random letters, {X:6} random letters and digits, {LUHN} check digit over the digits to its left. Write {{ and }} for literal braces.

Any whole number up to 30 digits. Starting well above 1 is a common habit, so an early customer cannot tell they were the first.

A step above 1 widens the gaps between references without hiding the pattern. Use the scramble option for that instead.

Permutes the counter inside its {SEQ:n} field so references are unique but not consecutive. Needs exactly one {SEQ:n} field with a width. Obfuscation, not encryption — see the notes.

Used by {YYYY} and {YY}. A parameter rather than a clock reading, so a shared link renders the same references for ever.

Used by {MM} and, divided into thirds, by {Q}.

Used by {DD}. Checked against the month and the Gregorian leap rule, so 29 February only works in a leap year.

Drives the {N}, {A} and {X} fields. The same seed always gives the same references.

Ajustar a aparência

Escolha primeiro uma predefinição ao lado da imagem — estes controles a ajustam.

Frame

A border drawn inside the edge of the image.

Avançado

Resultados

50 valores

ORD-2026-001001, ORD-2026-001002, ORD-2026-001003, ORD-2026-001004, ORD-2026-001005, ORD-2026-001006, ORD-2026-001007, ORD-2026-001008, ORD-2026-001009, ORD-2026-001010, ORD-2026-001011, ORD-2026-001012, ORD-2026-001013, ORD-2026-001014, ORD-2026-001015, ORD-2026-001016, ORD-2026-001017, ORD-2026-001018, ORD-2026-001019, ORD-2026-001020, ORD-2026-001021, ORD-2026-001022, ORD-2026-001023, ORD-2026-001024, ORD-2026-001025, ORD-2026-001026, ORD-2026-001027, ORD-2026-001028, ORD-2026-001029, ORD-2026-001030, ORD-2026-001031, ORD-2026-001032, ORD-2026-001033, ORD-2026-001034, ORD-2026-001035, ORD-2026-001036, ORD-2026-001037, ORD-2026-001038, ORD-2026-001039, ORD-2026-001040, ORD-2026-001041, ORD-2026-001042, ORD-2026-001043, ORD-2026-001044, ORD-2026-001045, ORD-2026-001046, ORD-2026-001047, ORD-2026-001048, ORD-2026-001049, ORD-2026-001050

50 references from "ORD-{YYYY}-{SEQ:6}", counting up by one from 1001. A consecutive series is readable in both directions: two of these references disclose how many orders fall between them. These are test fixtures and point at no real order.


Criar uma imagem

Ative o JavaScript para estilizar estes números e baixá-los como imagem. Os valores em si estão listados acima.

Text on the image

Drag a line straight onto the picture to place it — once placed, it stays exactly where you put it. Everything here is drawn into the download.

O artigo de contexto abaixo ainda não foi traduzido e aparece em inglês.

Sobre números de pedido

Order numbers are a mail-order invention. Aaron Montgomery Ward began trading from Chicago in 1872 with a price list and no shop at all; Richard Sears and Alvah Roebuck followed in the 1890s. A business that never meets its customers has to join a letter, a payment, a packed parcel and a complaint to the same transaction, and across four departments the only thing that can carry that join is a number written on every piece of paper. Sequential numbering came free, because the orders arrived in a pile and were numbered as they were opened.

Its weakness was discovered by other people's statisticians. During the Second World War, Allied economic intelligence estimated German tank production from the serial numbers of captured and destroyed vehicles, working mainly from gearbox numbers because those fell in two unbroken sequences, with chassis, engine and wheel numbers used to cross-check. The reasoning is that a sample of serials drawn from a consecutive run tells you how long the run is. Richard Ruggles and H. Brodie set the work out in the Journal of the American Statistical Association in 1947; their own rule of thumb, tucked into a footnote, was to estimate the total as the sample maximum plus the average gap between observations. German records recovered after the war showed the statistical estimates had been far more accurate than the conventional intelligence estimates they were meant to check, and the method is now taught as the German tank problem.

The same arithmetic works on a shop. Place two orders a week apart, subtract one reference from the other, and you have the volume in between; a figure a company would never publish is legible from two emailed receipts. Web applications then added a second problem: an order reference that appears in a URL and is checked against no owner lets a visitor walk the sequence and read other people's orders — the flaw catalogued by OWASP as an insecure direct object reference, now folded into Broken Access Control.

The usual answer is to separate the two jobs. Accounting keeps a private, gapless, sequential key; the customer is shown something else — a reference with a check digit so it survives being read down a phone line, or a permuted one that is unique without sitting next to its neighbours.

Propriedades principais

  • Two references from a consecutive series disclose the number of orders between them, so a sequential customer-facing number publishes order volume to anyone holding two receipts.
  • The German tank problem estimates the size of a consecutively numbered population from a sample: for sampling without replacement the minimum-variance unbiased estimate is m + m/k − 1, where m is the largest serial seen and k the number of serials seen.
  • The scramble option applies n → (6364136223846793·n + 1442695040888963) mod 10^w and then reverses the w-digit zero-padded result, where w is the width of the {SEQ:n} field.
  • Both steps are one-to-one — the multiplier ends in 3, so it shares no factor with 10 and hence none with 10^w, and reversal is a bijection on fixed-width digit strings — so distinct counters can never collide.
  • The reversal is what makes the output look unpatterned, because the affine map alone sends consecutive counters a constant distance apart — but the whole composition is still a fixed, unkeyed permutation, so it is obfuscation and not encryption.
  • The modulus 10^24 is about 10^8 times larger than the exact integer range of a double, so the counter and the permutation are computed with arbitrary-precision integers throughout.
  • A Luhn check digit catches every single-digit error and every swap of two adjacent digits except 09 for 90, which is why it is worth having on a reference that gets read aloud.
  • The pattern fields are {SEQ:n} for the padded counter, {YYYY}, {YY}, {MM}, {DD} and {Q} for the date, {N:n} for random digits, {A:n} for random letters, {X:n} for random letters and digits, and {LUHN} for a check digit over the digits to its left.

Onde aparecem

  • The reference printed on a receipt and quoted back during a support call, which is the only identifier a customer ever has for their order.
  • Hosted storefronts commonly start a new shop’s numbering well above 1, so that an early customer cannot tell from their reference that they were the first — a convention rather than a rule.
  • Marketplace references are often split into blocks, as Amazon’s three-seven-seven grouping is, which makes them far easier to read back accurately than an undivided string of digits.
  • Warehouse pick lists, carrier consignment numbers and payment-provider references all key back to the order number, which is why changing its format late is painful.
  • Serial-number analysis of the same kind was turned on other wartime equipment, most successfully against V-2 rocket production, which is a reminder that the technique needs only a consecutive series and a few samples of it.
  • Libraries such as Hashids and its successor Sqids exist specifically to turn a database id into a short, non-consecutive public string, which is the same job the scramble option does here.

Como usar este gerador

Os valores gerados aparecem no topo, com um botão de copiar ao lado. Para transformá-los em imagem, escolha um visual entre os estilos em Criar uma imagem, selecione um tamanho de exportação e baixe em PNG, JPEG ou WebP. Tudo é renderizado no seu navegador, então nada do que você gera é enviado a um servidor.

A barra de endereços é atualizada enquanto você trabalha, então o link sempre reproduz exatamente o que você vê — útil para compartilhar uma sequência específica ou guardar uma configuração. Use Copiar para levar os valores como texto puro, ou Exportar dados para CSV, JSON, NDJSON, SQL ou XML.

Fontes

Os resumos históricos desta página se baseiam nas referências de licença aberta listadas acima. Encontrou um erro? Avise-nos e vamos corrigir.