The function only reads the buffer, so marking it const clarifies intent and prevents accidental modification.