Does Microsoft release its SQL Query Hash Algorithm..? We use SQL Spotlight in our environment. it's pretty handy. 
we use particularly the output of sys.dm_exec_requests and sys.dm_exec_query_stats.

Spotlight pulls the query plan from the plan cache for you using the hash which is nice. 

Problem is, unless you're experienced with the code base, it's quite difficult to know where that query came from. 

I had an idea that if I could:


Parse the codebase
Pull the SQL queries 
Hash them the same way microsoft does


This way I could do quick matches of the hash to be able see where in the codebase a particular query came from.

Alternatively I'd have to do some very slow regex...
Does Microsoft release its SQL Query Hash Algorithm..?


No, Microsoft does not release the hashing algorithm. Additionally, hashing happens at a different layer than original query text - so even if you had the algorithm, you'd still need to normalize like SQL Server does, first.


  This way I could do quick matches of the hash to be able see where in the codebase a particular query came from.


This assumes there also isn't anything like dynamic sql, SMO, etc., where there isn't an actual plain text query.