úÎ!–F‘nJ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI#© 2017 Marko Bencun, 2019-2020 IOHK Apache-2.0None .;HMUV_¶4bech32 Represents a  data word of 5 bits in width.VEach character in the data portion of a Bech32 string encodes exactly 5 bits of data.Construction and DeconstructionUse the J and K) functions to construct and deconstruct  values. Packing Words into Data PayloadsUse the  and  functions to pack and unpack & values into and out of data payloads.bech32KThe zero-based position of a character in a string, counting from the left.JValues of this type are typically used to reflect the positions of errors.See .bech32URepresents the set of errors that may occur while decoding a Bech32 string with the ' function.bech32The string to decode is  longer than +.bech32The string to decode is  shorter than ,.bech32The string to decode contains both upper case and lower case characters.bech32$The string to decode is missing the separator character, specified by (. bech32*The string to decode contains one or more invalid characters.In cases where it is§ possible to determine the exact locations of erroneous characters, this list will encode those locations. Clients can use this information to provide user feedback.In cases where it isn't` possible to reliably determine the locations of erroneous characters, this list will be empty. bech32XRepresents the set of error conditions that may occur while encoding a Bech32 string. bech32&The resultant encoded string would be  longer than +. bech32rRepresents the set of error conditions that may occur while parsing the human-readable part of a Bech32 string. bech32The human-readable part is  shorter than .bech32The human-readable part is  longer than  .bech32JThe human-readable part contains one or more characters whose values are  less than " or  greater than #.bech32KRepresents the human-readable part of a Bech32 string, as defined here: https://git.io/fj8FSbech32ARepresents the data part of a Bech32 string, as defined here: https://git.io/fj8FSbech32 Returns true iff. the specified  is valid.bech32 Constructs a  from a L.This function encodes a LH in such a way that guarantees it can be successfully decoded with the  function: /dataPartToBytes (dataPartFromBytes b) == Just bbech32Attempts to extract a L from a .;This function guarantees to satisfy the following property: /dataPartToBytes (dataPartFromBytes b) == Just bbech32 Constructs a  from textual input.0All characters in the input must be a member of U, the set of characters permitted to appear within the data part of a Bech32 string.Returns M3 if any character in the input is not a member of .;This function guarantees to satisfy the following property: -dataPartFromText (dataPartToText d) == Just dbech32 Converts a  to N7, using the Bech32 character set to render the data.;This function guarantees to satisfy the following property: -dataPartFromText (dataPartToText d) == Just dbech32 Construct a  directly from a list of words.=This function guarantees to satisfy the following properties: UdataPartFromWords (dataPartToWords d) == d dataPartToWords (dataPartFromWords w) == wbech32 Unpack a & into a list of its constituent words.=This function guarantees to satisfy the following properties: UdataPartFromWords (dataPartToWords d) == d dataPartToWords (dataPartFromWords w) == wObech32lReturns true iff. the specified character is permitted to appear within the data part of a Bech32 string.See here for more details: https://git.io/fj8FSbech32aA list of all characters that are permitted to appear within the data part of a Bech32 string.See here for more details: https://git.io/fj8FSbech32–If the specified character is permitted to appear within the data part of a Bech32 string, this function returns that character's corresponding m value. If the specified character is not permitted, or if the specified character is upper-case, returns M.bech32Maps the specified Y onto a character that is permitted to appear within the data part of a Bech32 string.bech32GParses the human-readable part of a Bech32 string, as defined here: https://git.io/fj8FSbech32?Get the raw text of the human-readable part of a Bech32 string.bech32=Convert the specified human-readable part to a list of words.bech32PThe shortest length permitted for the human-readable part of a Bech32 string. bech32OThe longest length permitted for the human-readable part of a Bech32 string.!bech32vReturns true iff. the specified character is permitted to appear within the human-readable part of a Bech32 string."bech32rThe lower bound of the set of characters permitted to appear within the human-readable part of a Bech32 string.#bech32rThe upper bound of the set of characters permitted to appear within the human-readable part of a Bech32 string.$bech32Like %3 but allows output to be longer than 90 characters.€This isn't ideal, as Bech32 error detection becomes worse as strings get longer, but it may be useful in certain circumstances.From  #https://en.bitcoin.it/wiki/BIP_0173BIP-0173:¯"Even though the chosen code performs reasonably well up to 1023 characters, other designs are preferable for lengths above 89 characters (excluding the separator)."%bech32EEncode a Bech32 string from a human-readable prefix and data payload.Exampleimport Preludeimport Codec.Binary.Bech32import Data.Text.Encoding'First, prepare a human-readable prefix:2Right prefix = humanReadablePartFromText "example"Next, prepare a data payload:/messageToEncode = "Lorem ipsum dolor sit amet!"9dataPart = dataPartFromBytes $ encodeUtf8 messageToEncode!Finally, produce a Bech32 string:encode prefix dataPartBRight "example1f3hhyetdyp5hqum4d5sxgmmvdaezqumfwssxzmt9wsss9un3cx"&bech32Like '' but does not enforce a maximum length. See also $ for details.'bech32EDecode a Bech32 string into a human-readable prefix and data payload.Exampleimport Preludeimport Codec.Binary.Bech32import Data.Text.EncodingFirst, decode the input:Dinput = "example1f3hhyetdyp5hqum4d5sxgmmvdaezqumfwssxzmt9wsss9un3cx"'Right (prefix, dataPart) = decode input0Next, examine the decoded human-readable prefix:humanReadablePartToText prefix "example"*Finally, examine the decoded data payload:'decodeUtf8 <$> dataPartToBytes dataPart"Just "Lorem ipsum dolor sit amet!"Pbech32ÙParse a data-with-checksum part, checking that each character is part of the supported character set. If one or more characters are not in the supported character set, return the list of illegal character positions.Qbech32`Convert an error encountered while parsing a human-readable part into a general decoding error.(bech32The separator character.pThis character appears immediately after the human-readable part and before the data part in an encoded string.)bech32BThe length of the checksum portion of an encoded string, in bytes.*bech32CThe length of the separator portion of an encoded string, in bytes.+bech322The maximum length of an encoded string, in bytes.sThis length includes the human-readable part, the separator character, the encoded data portion, and the checksum.,bech322The minimum length of an encoded string, in bytes.sThis length includes the human-readable part, the separator character, the encoded data portion, and the checksum.0bech321Big-endian conversion of a word string from base  '2^frombits' to base  '2^tobits'. The frombits and twobits% parameters must be positive, while  '2^frombits' and  '2^tobits'" must be smaller than the size of R. Every value in dat must be strictly smaller than  '2^frombits'.Sbech32_This lookup table is a Haskell translation of the reference JavaScript implementation here: https://git.io/fj8FRTbech32_This lookup table is a Haskell translation of the reference JavaScript implementation here: https://git.io/fj8FEUbech32[This function is a Haskell translation of the reference JavaScript implementation here: https://git.io/fj8FuVbech32”For a given Bech32 string residue and Bech32 string length, reports the positions of detectably erroneous characters in the original Bech32 string.¨The reported character positions are zero-based, counting from right to left within the original string, but omitting the separation character (which is not counted).\Returns the empty list if it is not possible to reliably determine the locations of errors.YThis function is a Haskell translation of the reference JavaScript implementation here: https://git.io/fj8FzWbech32Splits the given N€ into a prefix and a suffix using the last occurrence of the specified separator character as a splitting point. Evaluates to M if the specified N+ does not contain the separator character.3   !"#$%&'()*+,-./0123%$ '& )+,(*  !"#0-21/.#© 2017 Marko Bencun, 2019-2020 IOHK Apache-2.0NoneB%   "#$%&'(+,%%'   $& "#+,(X      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNLMOPQRLSTUVWXYZ[\]^_`abc#bech32-1.0.1-JfvsApTyGf4ETaIWPqKjyyCodec.Binary.Bech32.InternalCodec.Binary.Bech32Word5getWord5 CharPosition DecodingErrorStringToDecodeTooLongStringToDecodeTooShortStringToDecodeHasMixedCase"StringToDecodeMissingSeparatorChar"StringToDecodeContainsInvalidChars EncodingErrorEncodedStringTooLongHumanReadablePartErrorHumanReadablePartTooShortHumanReadablePartTooLong%HumanReadablePartContainsInvalidCharsHumanReadablePartDataPartdataPartIsValiddataPartFromBytesdataPartToBytesdataPartFromTextdataPartToTextdataPartFromWordsdataPartToWords dataCharListdataCharToWorddataCharFromWordhumanReadablePartFromTexthumanReadablePartToTexthumanReadablePartToWordshumanReadablePartMinLengthhumanReadablePartMaxLengthhumanReadableCharIsValidhumanReadableCharMinBoundhumanReadableCharMaxBound encodeLenientencode decodeLenientdecode separatorCharchecksumLengthseparatorLengthencodedStringMaxLengthencodedStringMinLengthword5 yesPadding noPadding convertBitstoBase32 toBase256 $fIxWord5 $fEnumWord5$fBoundedWord5 $fEqDataPart$fMonoidDataPart$fSemigroupDataPart$fShowDataPart$fEqHumanReadablePart$fMonoidHumanReadablePart$fSemigroupHumanReadablePart$fShowHumanReadablePart$fEqEncodingError$fShowEncodingError$fEqCharPosition$fOrdCharPosition$fShowCharPosition$fEqDecodingError$fShowDecodingError$fEqHumanReadablePartError$fShowHumanReadablePartError $fEqWord5 $fOrdWord5 $fShowWord5baseGHC.EnumtoEnumfromEnumbytestring-0.10.8.2Data.ByteString.Internal ByteString GHC.MaybeNothing text-1.2.3.1Data.Text.InternalTextdataCharIsValidparseDataWithChecksumParthumanReadablePartErrorghc-prim GHC.TypesWord gf_1024_exp gf_1024_logsyndrome locateErrorssplitAtLastOccurrence