by mytailorisrich · 6y ago · 0 comments
Random code snippets from the internet are obviously completely unsafe. There is therefore basic "due diligence" to apply when considering using one such snippet:
1. Very carefully read the code to understand it.
2. Test it (corner cases/threshold values are the trivial things to test for such a piece of code doing conversions)
In general I do not copy-paste code snippets. I use them as examples of how to perform a task or how to use an API, then I write my own code. This also avoids IP issues.
On the other hand, when I download and use Openssl (for example) I am reasonably confident that the code was developed and scrutinised by people who know what they are doing.