I'd prefer have these constants bytestrings (`b'sofi'`, etc.) and remove `.decode('ascii')` from the code. I know there are other places where constants are defined as strings and then data is decoded from ASCII to compare with a constant, but this is pointless and it's better to gradually fix that.