aoc2017-0.1.0.0: Advent of Code 2017 - my answers

Safe HaskellSafe
LanguageHaskell2010

Day10

Description

 

Synopsis

Documentation

reverseRange :: (IArray a e, Ix i, Num i) => a i e -> (i, i) -> a i e Source #

Reverse elements of an array in a range of indices. The range may wrap.

knotRanges :: (Ix i, Num i) => (i, i) -> [Int] -> [Maybe (i, i)] Source #

Given array bounds and a list of lengths, returns a list of ranges in the array, with each one starting at an increasing distance from the end of the previous, wrapping around the ends of the array.

hash :: (IArray a e, Ix i, Num i) => a i e -> [Int] -> a i e Source #

Sequentially reverses all ranges in an array from a list of lengths.

deriveKey :: String -> [Int] Source #

Adds some magic numbers to the codepoints to a string, repeated 64 times.

xorEach :: (IArray a e, Ix i, Bits e) => Int -> a i e -> [e] Source #

Reduce consecutive groups of a fixed length by xor.

hashString :: String -> [Word8] Source #

Deriving a key from a string by using its codepoints plus some magic numbers, hash [0..255] 64 times, then xor together each group of 16.