Keep the algorithm stable

QR Card retains its original encoder implementation and interface while adopting the V39 service contract. QR, Data Matrix, and Aztec GIF outputs are checked against hashes captured from the original service.

That is a concrete migration technique: compare a deterministic artifact before and after the hosting change. It narrows the question from whether the page looks similar to whether the same input still produces the same bytes.

Move the environment around it

The service binds to loopback, receives its port and public origin from the controller, and reports the exact revision through a health endpoint. Runtime code comes from committed local files. Mutable state stays outside the release source.

The controller supplies verified identity and handles public HTTPS. The encoder process does not receive cloud credentials or the Google client secret.

The hosting contract includes the release revision, public origin, and data directory, which makes environment changes explicit without forcing them into encoder functions or browser input.

Use the right kind of comparison

Golden-output hashes establish that known results were preserved across a change. They complement independent decoding and edge-case tests rather than replacing them. Together, deterministic artifacts and revision-bound health help distinguish an encoder regression from a hosting or release problem.