/// <summary>
        /// check if the address is valid
        /// </summary>
        /// <param name="encodedAddress">Address</param>
        /// <returns>valid or not</returns>
        public static bool IsValid(string encodedAddress)
        {
            // interpret as base32
            var checksumAddr = Base32.DecodeFromString(encodedAddress).ToList();

            if (checksumAddr.Count != LEN_BYTES + CHECKSUM_LEN_BYTES)
            {
                return(false);
            }
            // split into checksum

            byte[] checksum = checksumAddr.GetRange(LEN_BYTES, checksumAddr.Count - LEN_BYTES).ToArray();
            byte[] addr     = checksumAddr.GetRange(0, LEN_BYTES).ToArray();

            // compute expected checksum
            var hashedAddr = Digester.Digest(addr).ToList();

            byte[] expectedChecksum = hashedAddr.GetRange(LEN_BYTES - CHECKSUM_LEN_BYTES,
                                                          hashedAddr.Count - LEN_BYTES + CHECKSUM_LEN_BYTES).ToArray();

            // compare
            if (Enumerable.SequenceEqual(checksum, expectedChecksum))
            {
                return(true);
            }

            else
            {
                return(false);
            }
        }
 private byte[] GetAdressBytes(string encodedAddr)
 {
     byte[] checksumAddr = Base32.DecodeFromString(encodedAddr);
     return(JavaHelper <byte> .ArrayCopyOf(checksumAddr, LEN_BYTES));
 }