[Haskell-cafe] String to Word64 Conversion

Ian Sefferman iseff at iseff.com
Sun Apr 1 15:42:07 EDT 2007

I've been spending a lot of time trying to find a clean way to convert
from a String to a Word64 for the Crypto library.

Specifically, we're trying to encrypt the strings with Blowfish. The
type for the encrypt function is:

encrypt :: (Integral a) => a -> Word64 -> Word64

I assume I would want something like:
toWord64s :: String -> [Word64]
toWord64s = ....

myEncrypt string = map (Blowfish.encrypt myKey) (toWord64s string)

I would have to imagine that encrypting strings is a fairly common
thing to do, so a conversion should be trivial, but I can't seem to
find anything on it. I feel like I must be missing something rather
obvious here. Am I?


More information about the Haskell-Cafe mailing list