-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Encoding scheme to encode any Unicode string with only [0-9a-zA-Z_] -- -- Double-X-Encoding is an encoding scheme to encode any Unicode string -- with only characters from [0-9a-zA-Z_]. Therefore it's quite similar -- to URL percent-encoding. It's especially useful for GraphQL ID -- generation, as it includes support for encoding leading digits and -- double underscores. @package double-x-encoding @version 1.2.0 -- | Implementation of Double-X-Encoding encoder and decoder in Haskell -- -- Main functions: -- -- module DoubleXEncoding -- | Encoder mapping for ASCII characters. charEncode :: Char -> Char -- | Decoder mapping for ASCII characters. charDecode :: Char -> Char -- | Map hex characters to an alternative hex alphabet ranging from a to p -- instead of 0 to f. hexShiftEncode :: Char -> Char -- | Map alternative hex alphabet back to the original hex alphabet. hexShiftDecode :: Char -> Char -- | Options for encoding: -- -- -- -- Especially relevant for GraphQL, as the spec does not allow -- leading digits or double underscores for field names. data EncodeOptions EncodeOptions :: Bool -> Bool -> EncodeOptions [encodeLeadingDigit] :: EncodeOptions -> Bool [encodeDoubleUnderscore] :: EncodeOptions -> Bool -- | Encode a text using the Double-X-Encoding algorithm with provided -- options. doubleXEncodeWithOptions :: EncodeOptions -> Text -> Text -- | Default options with no leading digit encoding and no double -- underscore encoding. defaultOptions :: EncodeOptions -- | Encode a text using the Double-X-Encoding algorithm. -- --
--   >>> doubleXEncode "id-with.special$chars!"
--   "idXXDwithXXEspecialXX4charsXX1"
--   
doubleXEncode :: Text -> Text -- | Default options for GraphQL encoding. Leading digits or double -- underscores are not allowed for field names. gqlOptions :: EncodeOptions -- | Encode a text using the Double-X-Encoding algorithm with GraphQL -- options. -- --
--   >>> doubleXEncodeGql "1FileFormat__"
--   "XXZ1FileFormatXXRXXR"
--   
doubleXEncodeGql :: Text -> Text -- | Decode a Double-X-Encoding encoded text. -- --
--   >>> doubleXDecode "idXXDwithXXEspecialXX4charsXX1"
--   "id-with.special$chars!"
--   
doubleXDecode :: Text -> Text