Parallel brute force: Difference between revisions

m
Line 793:
</pre>
Or using worker threads with buffered read/write channels
<lang haskell>import Control.Concurrent (forkIO, writeList2Chan, setNumCapabilities)
import Control.Concurrent.Chan (Chan, newChan, readChan, ChanwriteList2Chan)
import Control.Monad (replicateM, forever, replicateM_)
import Crypto.Hash (hashWith, (SHA256(..), Digest, hashWith)
import Data.Bifunctor (first)
import Data.ByteString (pack)
import Data.Char (isDigit)
import Data.List.Split (chunksOf)
import Data.Word (Word8)
import System.Environment (getArgs)
import Text.Printf (printf)
 
type Decrypted = String
Anonymous user