Amazon.Runtime.Internal.DefaultRequest.ComputeContentStreamHash C# (CSharp) Метод

ComputeContentStreamHash() публичный Метод

Computes the SHA 256 hash of the content stream. If the stream is not seekable, it searches the parent stream hierarchy to find a seekable stream prior to computation. Once computed, the hash is cached for future use. If a suitable stream cannot be found to use, null is returned.
public ComputeContentStreamHash ( ) : string
Результат string
        public string ComputeContentStreamHash()
        {
            if (this.contentStream == null)
                return null;

            if (this.contentStreamHash == null)
            {
                var seekableStream = WrapperStream.SearchWrappedStream(this.contentStream, s => s.CanSeek);
                if (seekableStream != null)
                {
                    var position = seekableStream.Position;
                    byte[] payloadHashBytes = CryptoUtilFactory.CryptoInstance.ComputeSHA256Hash(seekableStream);
                    this.contentStreamHash = AWSSDKUtils.ToHex(payloadHashBytes, true);
                    seekableStream.Seek(position, SeekOrigin.Begin);
                }
            }

            return this.contentStreamHash;
        }