示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HashDeviceIdFormatter"/> class.
 /// </summary>
 /// <param name="hashAlgorithm">A function that returns the hash algorithm to use.</param>
 /// <param name="byteArrayEncoder">The <see cref="IByteArrayEncoder"/> to use to encode the resulting hash.</param>
 public HashDeviceIdFormatter(Func <HashAlgorithm> hashAlgorithm, IByteArrayEncoder byteArrayEncoder)
 {
     _hashAlgorithm    = hashAlgorithm ?? throw new ArgumentNullException(nameof(hashAlgorithm));
     _byteArrayEncoder = byteArrayEncoder ?? throw new ArgumentNullException(nameof(byteArrayEncoder));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="HashDeviceIdFormatter"/> class.
        /// </summary>

        /// <param name="byteArrayEncoder">The <see cref="IByteArrayEncoder"/> to use to encode the resulting hash.</param>
        public CastleHashDeviceIdFormatter(string salt, IByteArrayEncoder byteArrayEncoder)
        {
            _salt             = salt ?? throw new ArgumentNullException(nameof(salt));
            _byteArrayEncoder = byteArrayEncoder ?? throw new ArgumentNullException(nameof(byteArrayEncoder));
        }