title: How to return the hash result with limit size by using HASHBYTES function in SQL Server
body: <p>Can <code>HASHBYTES</code> function return the result which has limited size (e.g. to 20 characters) and make sure the hash result without collision ?</p>
  
  <p>Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse  </p>
  
  <pre><code>HASHBYTES ( '&lt;algorithm&gt;', { @input | 'input' } )  
  
      &lt;algorithm&gt;::= MD2 | MD4 | MD5 | SHA | SHA1 | SHA2_256 | SHA2_512 
  
  SELECT HASHBYTES('SHA1', 'This is a test.');
  </code></pre>
  
  <p>it returns </p>
  
  <pre><code>0x0E7AAB0B4FF0FD2DFB4F0233E2EE7A26CD08F173
  </code></pre>
  
  <p>the length is too long. I am not sure the first 20 characters like 0x0E7AAB0B4FF0FD2DFB whether will have a collision with another input. Actually, I want to get the unique key from converting the input by using <code>HASHBYTES</code> function in SQL Server.</p>