/// <summary> /// Creates a <see cref="BlobIdentifierWithBlocks"/> from the bytes provided /// </summary> /// <param name="blob">The content against which the identifier should be created</param> /// <returns> /// A <see cref="BlobIdentifierWithBlocks"/> instance representing the unique identifier for binary the content. /// </returns> public static BlobIdentifierWithBlocks CalculateBlobIdentifierWithBlocks(this byte[] blob) { using (var stream = new MemoryStream(blob)) { return(VsoHash.CalculateBlobIdentifierWithBlocks(stream)); } }
/// <summary> /// Creates a <see cref="BlobIdentifierWithBlocks"/> from the stream provided /// </summary> /// <param name="blob">The content stream against which the identifier should be created</param> /// <returns> /// A <see cref="BlobIdentifierWithBlocks"/> instance representing the unique identifier for binary the content. /// </returns> public static BlobIdentifierWithBlocks CalculateBlobIdentifierWithBlocks(this Stream blob) { blob.Position = 0; var result = VsoHash.CalculateBlobIdentifierWithBlocks(blob); blob.Position = 0; return(result); }