I remember a couple of years ago I read up about the details on how QR codes are created. Specifically the masks that are added at the end to ensure that there aren’t any areas with too much whitespace or something that ends up inadvertently looking like the corner of a QR code (that square inside a square thing).

And for some reason, I’m staring at two QR codes in front of me, looking at the details, one looks like it contains a pipe going around a corner, another looks like it has a bit of a star, which made me wonder… Why have I never seen a QR Code with a swastika or something else you really don’t want to have on there? I’ve never seen any word on filtering out stuff like that when it comes to masking.

Am I just too bored out of my mind so that I’m staring at QR Codes like this with way too much imagination or is there something I’m missing?

EDIT: I’m sure it’s possible to intentionally create one, I’m thinking more of accidentally creating one. Specifically when I see, for instance, a different QR code on the back of every seat in a train, for instance - you’re generating so many, no human is going to check that.

  • cobwoms@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    95
    arrow-down
    1
    ·
    edit-2
    3 days ago

    there’s a mask process in qr code generation. the masks aims to try to make it look like uniform noise, so you don’t end up with blocks/lines of pure white or pure black. so you won’t end up with any recognizable symbol in the usual algorithmic generation

    some more detail: it will use one of these patterns to invert some pixels until it finds one that results in more or less uniform noise.

    it will also add a set of pixels in a designated mask identification zone that instructs the decoder which mask was used