purr

password generation and secret sharing
Log | Files | Refs | README | LICENSE

Links.hs (550B)


      1 module Feature.Generation.Links ( genLink ) where
      2 
      3 import           Core.Types
      4 import           Data.List                 (singleton)
      5 import           Feature.Generation.Shared (rChar, rIndex, validChars)
      6 
      7 {- Generates a string containing randomly generated and capitalized characters.
      8    The length is determined by the LINKLENGTH environment variable. -}
      9 genLink :: Int -> IO GenLink
     10 genLink linkLength = genLink' linkLength (return "")
     11   where
     12     genLink' 0 cs = GenLink' <$> cs
     13     genLink' d cs = genLink' (d - 1) (cs <> (singleton <$> rChar))