CmisSync.Lib.Cmis.ConvenienceExtenders.CmisConvenienceExtenders.ContentStreamHash C# (CSharp) Метод

ContentStreamHash() публичный статический Метод

Returns the hash of the content stream on the server.
public static ContentStreamHash ( this doc, string type = "SHA-1" ) : byte[]
doc this Document with the content stream.
type string Type of the requested hash.
Результат byte[]
        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;
        }