/api/qmail/local/util/base32-encode

GET

Encode a non-negative decimal integer (typically a coin serial number) to QMail's custom base32 alphabet. Inverse of base32-decode.

Description

QMail uses a custom 32-character alphabet — ABCDEFGHJKLMNPQRSTUVWXYZ23456789 (omits I, O, 0, 1 to avoid visual confusion) — when serializing serial numbers into the local-part of an email address. This endpoint is a thin wrapper around that encoder so clients can produce identical strings.

Parameters

ParamTypeRequiredDescription
valueuint64 (decimal string)YesThe non-negative integer to encode.

Response

{
  "command": "base32",
  "success": true,
  "mode": "encode",
  "decimal": 8189,
  "base32": "PYV"
}

Errors

HTTPMessage
400Missing required parameter: value
400Invalid value for encode (must be a non-negative integer)
500Encoding failed

Example

curl "http://localhost:8081/api/qmail/local/util/base32-encode?value=8189"

Related