Esempio n. 1
0
        public void Generate(FlowLib.Containers.ContentInfo info)
        {
            if (info.ContainsKey(ContentInfo.STORAGEPATH))
            {
                TthThreaded tth = new TthThreaded(info.Get(ContentInfo.STORAGEPATH));
                tth.ThreadPriority = priority;
                tth.ThreadCount = count;
                byte[] bytes = tth.GetTTH_Value();
                info.Set(ContentInfo.TTH, Base32.Encode(bytes));
                //byte[][][] tree = tth.TTH;
                //if (tree != null && tree.Length > 0)
                //{
                //    int startIndex = 0;
                //    //if (tree.Length >= 8)
                //    //    startIndex = 7;
                //    long length = 0;
                //    System.IO.MemoryStream ms = new System.IO.MemoryStream();
                //    for (int i = 0; i < tree[startIndex].Length; i++)
                //    {
                //        // Ignore the rest if more then 65KiB has been writed
                //        //if (length > 66560)
                //        //    break;
                //        length += tree[startIndex][i].Length;
                //        ms.Write(tree[startIndex][i], 0, tree[startIndex][i].Length);
                //    }

                //    info.Set(ContentInfo.TTHL, Base32.Encode(ms.ToArray()));
                //}
            }
        }