Last active
July 29, 2016 11:29
-
-
Save ormaaj/fbde9e2c0a22d0bfadb52055631e39a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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