public static byte[] ContentStreamHash(this IDocument doc, string type = "SHA-1") {
if (doc.Properties == null) {
return null;
}
string prefix = string.Format("{{{0}}}", type.ToLower());
foreach (var prop in doc.Properties) {
if (prop.Id == "cmis:contentStreamHash") {
if (prop.Values != null) {
foreach (string entry in prop.Values) {
if (entry.StartsWith(prefix)) {
return StringToByteArray(entry.Substring(prefix.Length));
}
}
}
}
}
return null;
}