function decode_baseX(string, charset, paddingChar = undefined) {
  if (Math.log2(charset.length) % 1) throw Error(errorNotPowerOfTwo(charset.length))
  const bitsPerCharacter = Math.ceil(Math.log2(charset.length))
  const bc = new BitConsumer(8), result = []
  bc.onIntegerReady = value => result.push(value)
  for (const char of string) {
    if (char == paddingChar) break
    bc.consumeBitsFromInteger(xToBase10(char, charset), bitsPerCharacter)
  }
  return new Uint8Array(result)
}
/**
 * Decodes a string of data in the base defined in the charset into binary data. This is only possible when the base is a power of two. An optional padding character can be supplied if used in the encoding of the string.
 * @param {string} string The string with data stored using this base's charset.
 * @param {string} charset The charset which defines the base to use.
 * @param {string} [paddingChar] An optional padding character to supply if the encoding scheme makes use of it.
 * @returns {Uint8Array} A Uint8Array array containing the data.
 */
Decodes a string of data in the base defined in the charset into binary data. This is only possible when the base is a power of two. An optional padding character can be supplied if used in the encoding of the string.
@param {string} string The string with data stored using this base's charset.
@param {string} charset The charset which defines the base to use.
@param {string} [paddingChar] An optional padding character to supply if the encoding scheme makes use of it.
@returns {Uint8Array} A Uint8Array array containing the data.
Decodes a string of data in the base defined in the charset into binary data . This is only possible when the base is a power of two . An optional padding character can be supplied if used in the encoding of the string . @param { string } string The string with data stored using this base ' s charset . @param { string } charset The charset which defines the base to use . @param { string } [ paddingChar ] An optional padding character to supply if the encoding scheme makes use of it . @returns { Uint8Array } A Uint8Array array containing the data .
function decode_baseX(string, charset, paddingChar = undefined) {
  if (Math.log2(charset.length) % 1) throw Error(errorNotPowerOfTwo(charset.length))
  const bitsPerCharacter = Math.ceil(Math.log2(charset.length))
  const bc = new BitConsumer(8), result = []
  bc.onIntegerReady = value => result.push(value)
  for (const char of string) {
    if (char == paddingChar) break
    bc.consumeBitsFromInteger(xToBase10(char, charset), bitsPerCharacter)
  }
  return new Uint8Array(result)
}
function decode_baseX ( string , charset , paddingChar = undefined ) { if ( Math . log2 ( charset . length ) % 1 ) throw Error ( errorNotPowerOfTwo ( charset . length ) ) const bitsPerCharacter = Math . ceil ( Math . log2 ( charset . length ) ) const bc = new BitConsumer ( 8 ) , result = [ ] bc . onIntegerReady = value => result . push ( value ) for ( const char of string ) { if ( char == paddingChar ) break bc . consumeBitsFromInteger ( xToBase10 ( char , charset ) , bitsPerCharacter ) } return new Uint8Array ( result ) }
Decodes a string of data in the base defined in the charset into binary data.
Decodes a string of data in the base defined in the charset into binary data .