示例#1
0
        /// <summary>
        /// Decode the Base16-encoded string
        /// </summary>
        /// <param name="input">Base16-encoded string</param>
        /// <returns>Decoded bytes</returns>
        public byte[] Decode(string input)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            var impl = new Internal.Base16(BufferSize);

            return(impl.Decode(input));
        }
示例#2
0
        /// <summary>
        /// Encode bytes to a Base16-encoded string
        /// </summary>
        /// <param name="input">Bytes to encode</param>
        /// <param name="output">Base16-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.Base16(BufferSize);

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