$checksum can be your best friend too – fanciness simplified.
We all want or have that friend that will tell us when we have spinach in our teeth. You know, the type that pulls us to the side and says it… this isn’t to be confused for the type that says it at the least opportune time in front of your bosses’ boss but that story is for another time. We all have nightmares okay?
Back to the topic of this blog though… I have a friend who has my back in a way like no other – it tells me that some filthy entity has tampered with my beautiful code and saves my butt quite often.
Okay, backstory time:
Clients sometimes like to engage in what I like to call the event horizon guarantee.
That means, I ensure that everything is rotating around the black hole in a steady balance for x amount of time. If any variable in their environment changes, my guarantee either needs to account for this or will be void (should a third party /developer tamper with the code and ‘break’ the system). This of course, does not include security issues that result from a bug that I should have addressed.
It’s important to safeguard ourselves and clients by providing comprehensive agreements prior to project commencement so the stakes are clear.
This is where generating a checksum for your code comes in. I use this method in every project and you should too!(infact it should be one of multiple ways you check your code’s integrity).
$mychecksum = md5_file($codefilepath);
And that’s it, save this, automate your processes, and boom! one more way to be more secure.