-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Base62 encoding and decoding -- -- Encode and decode using the base62 encoding scheme. @package base62 @version 0.1.0.2 -- | This module provides functions for encoding fixed-width words using -- the base-62 encoding scheme. The encoding functions in this module -- produce byte sequences that are ASCII-compatible text encodings (e.g. -- ISO-8859-1 and UTF-8). Similarly, the decoding functions only decode -- byte sequences that are an ASCII-compatible text encoding of -- characters in the class [A-Za-Z0-9]. Other encodings (notably -- UTF-16) are not supported but would be accepted in a pull request. module Data.Word.Base62 -- | Base62 encode a 64-bit word. Leading zero bits are suppressed. -- --
--   >>> putStrLn (Bytes.toLatinString (Bytes.fromByteArray (encode64 213635)))
--   tZj
--   
-- -- Note that this will encode the number 0 as the character 0 rather than -- as the empty byte array. encode64 :: Word64 -> ByteArray -- | Base62 encode a 64-bit word as a builder. builder64 :: Word64 -> Builder 11 -- | Decode a base62-encoded 64-bit word. This rejects the empty string -- rather than decoding it as zero. This also rejects encoded numbers -- greater than or equal to 2^64. -- --
--   >>> decode64 (Bytes.fromAsciiString "LygHa16AHYB")
--   Just 18446744073709551611
--   
--   >>> decode64 (Bytes.fromAsciiString "1IdHllabYuAOlNK4")
--   Nothing
--   
decode64 :: Bytes -> Maybe Word64 -- | Base62 encode a 128-bit word. Leading zero bits are suppressed. -- --
--   >>> let octillion = 1_000_000_000_000_000_000_000_000_000
--   
--   >>> putStrLn (Bytes.toLatinString (Bytes.fromByteArray (encode128 octillion)))
--   1IdHllabYuAOlNK4
--   
encode128 :: Word128 -> ByteArray -- | Base62 encode a 128-bit word as a builder. builder128 :: Word128 -> Builder 22 -- | Decode a base62-encoded 128-bit word. This rejects the empty string -- rather than decoding it as zero. This also rejects encoded numbers -- greater than or equal to 2^128. -- --
--   >>> decode128 (Bytes.fromAsciiString "LygHa16AHYB")
--   Just 18446744073709551611
--   
--   >>> decode128 (Bytes.fromAsciiString "7n42DGM5Tflk9n8mt7Fhc6")
--   Just 340282366920938463463374607431768211454
--   
--   >>> decode128 (Bytes.fromAsciiString "7n42DGM5Tflk9n8mt7Fhc9")
--   Nothing
--   
decode128 :: Bytes -> Maybe Word128