Is the given address a p2wpkh address?
769380
def btc_is_p2wpkh_address( address ):
    
    wver, whash = segwit_addr_decode(address)
    if whash is None:
        return False

    if len(whash) != 20:
        return False

    return True
1347473
private static boolean isIPv4MappedAddress(final byte[] addr) {
    if (addr.length < INADDR16SZ) {
      return false;
    }
    return addr[0] == 0x00 && addr[1] == 0x00 && addr[2] == 0x00 && addr[3] == 0x00
        && addr[4] == 0x00 && addr[5] == 0x00 && addr[6] == 0x00 && addr[7] == 0x00
        && addr[8] == 0x00 && addr[9] == 0x00 && addr[10] == (byte) 0xff && addr[11] == (byte) 0xff;
  }
296911
private boolean isPayloadTooLong() {
		try {
			byte[] bytes = getPayloadAsBytesUnchecked();
			if (bytes.length > getMaximumPayloadSize()) return true;
		} catch (Exception e) {
		}
		return false;
	}
887843
def make_pkh_address(pubkey, witness=False, cashaddr=True):
    '''
    
    '''
    pubkey_hash = utils.hash160(pubkey)
    return _make_pkh_address(pubkey_hash=pubkey_hash,
                             witness=witness,
                             cashaddr=cashaddr)
221287
function peerResolved (ip, addressType) {
    // Possible cancelation during DNS lookup.
    if (!socket._connecting) return;

    socket._peer = { address: ip || '127.0.0.1', port: options.port };

    // Generate random bytes used to set randomized socket properties.
    // `crypto.randomBytes` calls OpenSSL `RAND_bytes` to generate the bytes.
    //
    //  * [RAND_bytes](http://www.openssl.org/docs/crypto/RAND_bytes.html).
    //  * [node_crypto.cc](https://github.com/joyent/node/blob/v0.8/src/node_crypto.cc#L4517)
    crypto.randomBytes(4, valid(randomzied));
  }
1129015
function mkZAddress(a_pk, pk_enc, zcPaymentAddressHash) {
  zcPaymentAddressHash = zcPaymentAddressHash || zconfig.mainnet.zcPaymentAddressHash;

  const buf = Buffer.from(zcPaymentAddressHash + a_pk + pk_enc, 'hex');
  return bs58check.encode(buf).toString('hex');
}
838586
boolean isEligible(Address address, @Nullable List<Route> routes) {
    // If this connection is not accepting new exchanges, we're done.
    if (transmitters.size() >= allocationLimit || noNewExchanges) return false;

    // If the non-host fields of the address don't overlap, we're done.
    if (!Internal.instance.equalsNonHost(this.route.address(), address)) return false;

    // If the host exactly matches, we're done: this connection can carry the address.
    if (address.url().host().equals(this.route().address().url().host())) {
      return true; // This connection is a perfect match.
    }

    // At this point we don't have a hostname match. But we still be able to carry the request if
    // our connection coalescing requirements are met. See also:
    // https://hpbn.co/optimizing-application-delivery/#eliminate-domain-sharding
    // https://daniel.haxx.se/blog/2016/08/18/http2-connection-coalescing/

    // 1. This connection must be HTTP/2.
    if (http2Connection == null) return false;

    // 2. The routes must share an IP address.
    if (routes == null || !routeMatchesAny(routes)) return false;

    // 3. This connection's server certificate's must cover the new host.
    if (address.hostnameVerifier() != OkHostnameVerifier.INSTANCE) return false;
    if (!supportsUrl(address.url())) return false;

    // 4. Certificate pinning must match the host.
    try {
      address.certificatePinner().check(address.url().host(), handshake().peerCertificates());
    } catch (SSLPeerUnverifiedException e) {
      return false;
    }

    return true; // The caller's address can be carried by this connection.
  }
386421
def p2pkh_script(network: str, address: str) -> P2pkhScript:
    ''''''

    network_params = net_query(network)

    addr = Address.from_string(network=network_params,
                               string=address)

    return P2pkhScript(addr)
809170
def standard_address(network: nil)
      if public_key_hash_script?
        return BTC::PublicKeyAddress.new(hash: @chunks[2].pushdata, network: network)
      elsif script_hash_script?
        return BTC::ScriptHashAddress.new(hash: @chunks[1].pushdata, network: network)
      elsif public_key_script?
        return BTC::PublicKeyAddress.new(hash: BTC.hash160(@chunks[0].pushdata), network: network)
      end
      nil
    end
159491
def address_checksum(address):
    
    address_bytes = address
    h = blake2b(digest_size=5)
    h.update(address_bytes)
    checksum = bytearray(h.digest())
    checksum.reverse()
    return checksum
667139
def to_address(self):
        
        key = unhexlify(self.get_public_key_hex())
        # First get the hash160 of the key
        hash160_bytes = hash160(key)
        # Prepend the network address byte
        network_hash160_bytes = \
            chr_py2(self.network.PUBKEY_ADDRESS) + hash160_bytes
        # Return a base58 encoded address with a checksum
        return ensure_str(base58.b58encode_check(network_hash160_bytes))
435205
def is_address(value: Any) -> bool:
    
    if is_checksum_formatted_address(value):
        return is_checksum_address(value)
    elif is_hex_address(value):
        return True
    elif is_binary_address(value):
        return True
    else:
        return False
743241
def address(self, is_compressed=None):
        
        return self._network.address.for_p2pkh(self.hash160(is_compressed=is_compressed))
1198585
def is_singlesig_address(addr, blockchain='bitcoin', **blockchain_opts):
    
    if blockchain == 'bitcoin':
        return btc_is_singlesig_address(addr, **blockchain_opts)
    else:
        raise ValueError('Unknown blockchain "{}"'.format(blockchain))
681670
def is_canonical_address(address: Any) -> bool:
    
    if not is_bytes(address) or len(address) != 20:
        return False
    return address == to_canonical_address(address)
410754
public static boolean hasLiteralIPAddress(URI resource) {
        String host = resource.getHost();
        if ( host == null || host.isEmpty() ) {
            return false;
        }
        // basic check for a '.'-separated numeric string for now
        return host.matches("([0-9A-Fa-f]|\\.){4,16}");
    }
937062
private boolean isIPAddress(@Nonnull String address) {
        return (InetAddressUtils.isIPv4Address(address) || InetAddressUtils.isIPv6Address(address));
    }