Without reading the code, how do you know you're not inadvertently reimplementing something the same way a GPL program does?
If you are truly concerned about this, the best way to avoid copyright complaints is to be aware of what's out there already and deliberately build a different implementation. I would argue that it is more beneficial -- from your point of view -- to read as much GPL code as possible.
Let's stipulate that this hashing scenario (I don't know much about it) is an example of a common algorithm that is the best way to solve a specific problem... it probably is. The only way in the US to defend that premise legally is to go to court. If the court decides against you, you have to lobby the legislature. Is the process convoluted and costly to the point of being broken? Probably, but this is how the the law comes to grips with changes in society, and there's really no alternative if you want to live and work in the light of day.
> This solution, even if not directly copied, might end up in the code of the proprietary (and patented) product.
I and many others are deeply opposed to proprietary and patented software. I (of course) understand you need resources to build software, but I think there are other ways to acquire those resources. The vast majority of software that people use is open source, free software (Firefox, Chrome, Nginx, Apache, Java, PHP, .NET, Linux, Android, MySQL), and this has been amazingly great for society (admittedly mostly rich, western society though). Can you imagine the cost of a browser if everyone had to license it and all the technologies contained therein? PNG, JPEG, GIF, SVG, SSL, JSON, XML, 2D rendering, font rendering and layout, hardware accelerated rendering, JavaScript, JavaScript interpretation & JIT, DOM processing, CSS application, user interface toolkits, video codecs, audio codecs, network protocol licenses, memory management algorithms, blah blah blah. By the time you were done, Firefox would cost $60 a copy - if you were lucky.