title: SQL Server. DataType for password hash (sha 512)
body: <p>Wondering which data type to select for my SQL Server to store the sha512 password hash. (hashed value will always have fixed length)</p>
  <pre class="lang-sql prettyprint-override"><code> declare @hashedPasswd varchar(max)
   set @hashedPasswd = convert(varchar(max), HASHBYTES('SHA2_512', 'any password with any langth'), 1)
   select len (@hashedPasswd)
  </code></pre>
  <p>always returns length of 130.</p>
  <p>What is the best choice for datatype of the column?
  Variants are nvarchar(max), nvarchar(130), varchar, char.
  If I understand correctly, nvarchar is a waste of space in my case, because It will be only ASCII symbols in hashed value.</p>
  <p>Please assist.</p>