billstclair/elm-crypto-string/3.0.0

NOTE: the latest version is 3.0.1

Crypto.Strings.Encoding

Encoders and decoders from and to strings and blocks.

Config elements

Key Encodings

A KeyEncoding for foldedSha256KeyEncoder

Encodings

base64Encoding : Int -> Encoding

How to encode/decode strings to/from Base64

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

hexEncoding : Encoding

How to encode/decode strings to/from hex.

Translate between strings and byte lists.

plainTextDecoder : List Int -> String

Decode UTF-8 bytes into a string.

plainTextEncoder : String -> List Int

Encode a string as UTF-8 bytes

Implementations of the Config elements

foldedSha256KeyEncoder : 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.

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.

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.