Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Program {
static void Main(string[] args) {
var dict = new ConcurrentDictionary<string, ConcurrentBag<string>>();
Directory.GetFiles("/home/ormaaj/doc/text/ebooks/programming/unsorted")
.AsParallel()
.ForAll(x => dict.AddOrUpdate(
BitConverter.ToString(SHA256.Create().ComputeHash(File.OpenRead(x))),
new ConcurrentBag<string>() { x },
(y, z) => { z.Add(y); return z; }));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.