Using hardcoded 4 is bad practice here. Please either have the MAC length be configurable as I suggested above or a symbolic constant set to 4.