billstclair/elm-crypto-string/1.0.1

NOTE: this package is not compatible with Elm 0.19.1

Crypto.Strings.Encoding

Encoders and decoders from and to strings and blocks.

Functions

keyEncoder : BlockSize -> String -> Block

Hash and fold a passphrase to turn it into a raw key array.

fold : Int -> List Int -> List Int

Fold a list of integers to a specified size.

Actually XORs too-long pieces together to not lose any entropy.

Worth the effort? I don't know. Hashing probably does enough.

plainTextDecoder : List Int -> String

Decode UTF-8 bytes into a string.

plainTextEncoder : String -> List Int

Encode a string as UTF-8 bytes

base64Encoding : Int -> Encoding

How to encode/decode strings to/from Base64

The Int parameter is the line length for encoding to a string.

base64Encoder : Int -> List Int -> String

Convert bytes to Base64.

base64Decoder : String -> Result String (List Int)

Convert a Base64 string to bytes. Sometimes the string is malformed.

TODO: This should return a Block, and the Chaining.remover should convert it into a list of Blocks.

hexEncoding : Encoding

How to encode/decode strings to/from hex.

hexEncoder : List Int -> String

Convert bytes to hex.

hexDecoder : Int -> String -> Result String (List Int)

Convert a hex string to bytes. Sometimes the string is malformed.