Exemplo n.º 1
0
        /// <summary>
        /// Decode the Base32-encoded string
        /// </summary>
        /// <param name="input">Base32-encoded string</param>
        /// <returns>Decoded bytes</returns>
        public byte[] Decode(string input)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            var impl = new Internal.Base32(BufferSize, OptionalPadding);

            return(impl.Decode(input));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Encode bytes to a Base32-encoded string
        /// </summary>
        /// <param name="input">Bytes to encode</param>
        /// <param name="output">Base32-encoded string</param>
        public Task EncodeStreamAsync(Stream input, Stream output)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }
            if (output == null)
            {
                throw new ArgumentNullException(nameof(output));
            }

            var impl = new Internal.Base32(BufferSize, OptionalPadding);

            return(impl.EncodeAsync(input, output));
        }