Get a mask string for masking the given `confidentialSequence`.

@param confidentialSequence the string to be obfuscated
@param unmasked             the section of `confidentialSequence` to be left unmasked
@return a mask string
424382
@VisibleForTesting
    String obfuscateConfidentialData(final CharSequence confidentialSequence, @Nullable final CharSequence unmasked) {
        final int maskedLength = unmasked == null ? confidentialSequence.length() : confidentialSequence.length() - unmasked.length();
        return new String(new char[maskedLength]).replace('\0', PAD_CHAR);
    }
1317653
public com.google.privacy.dlp.v2.CharacterMaskConfigOrBuilder getCharacterMaskConfigOrBuilder() {
    if (transformationCase_ == 3) {
      return (com.google.privacy.dlp.v2.CharacterMaskConfig) transformation_;
    }
    return com.google.privacy.dlp.v2.CharacterMaskConfig.getDefaultInstance();
  }
925687
def mask_keys(announce_url):
    
    return PASSKEY_RE.sub(
        lambda m: m.group() if m.group() in PASSKEY_OK else "*" * len(m.group()),
        announce_url)
829299
def mask_sequence(seq, gaps):
    
    seq = [i.upper() for i in seq]
    for gap in gaps:
        for i in range(gap[0] - 1, gap[1]):
            seq[i] = seq[i].lower()
    return ''.join(seq)
985545
void remask() {
    if (parsedFormatInfo == null) {
      return; // We have no format information, and have no data mask
    }
    DataMask dataMask = DataMask.values()[parsedFormatInfo.getDataMask()];
    int dimension = bitMatrix.getHeight();
    dataMask.unmaskBitMatrix(bitMatrix, dimension);
  }
1198191
public function unmaskToken($maskedToken)
	{
		$decoded=base64_decode(strtr($maskedToken,'-_','+/'));
		$length=$this->strlen($decoded)/2;
		// Check if the masked token has an even length.
		if(!is_int($length))
			return '';
		return $this->substr($decoded,$length,$length)^$this->substr($decoded,0,$length);
	}
928958
public static String obfuscate(String s)
    {
        StringBuffer buf = new StringBuffer();
        byte[] b = s.getBytes();
        
        synchronized(buf)
        {
            buf.append("OBF:");
            for (int i=0;i<b.length;i++)
            {
                byte b1 = b[i];
                byte b2 = b[s.length()-(i+1)];
                int i1= (int)b1+(int)b2+127;
                int i2= (int)b1-(int)b2+127;
                int i0=i1*256+i2;
                String x=Integer.toString(i0,36);

                switch(x.length())
                {
                  case 1:buf.append('0');
                  case 2:buf.append('0');
                  case 3:buf.append('0');
                  default:buf.append(x);
                }
            }
            return buf.toString();
        }
    }
1289856
public String toEscapedString() {
        List<String> parts = Lists.newArrayList( getName() );
        parts.addAll( getValues() );
        String escapedString = escape( Joiner.on( '-' ).join( parts ) );
        return escapedString.substring( 0, Math.min( escapedString.length(), 255 ) );
    }
1178499
public PrivateKey unwrapPrivateKey(String wrappedKey) {

        return (PrivateKey) unwrap(wrappedKey, Keys.ASYMMETRIC_ALGORITHM,
                Cipher.PRIVATE_KEY, WRAP_ALGORITHM_ASYMMETRIC);
    }
878464
protected static void unmask(ByteBuffer buf, int mask) {
        if (!buf.hasRemaining()) {
            return;
        }

        byte b;
        int start = buf.position();
        int remainder = buf.remaining() % 4;
        int remaining = buf.remaining() - remainder;
        int end = remaining + buf.position();

        // xor a 32bit word at a time as long as possible
        while (buf.position() < end) {
            int plaintext = buf.getInt(buf.position()) ^ mask;
            buf.putInt(plaintext);
        }

        // xor the remaining 3, 2, or 1 bytes
        switch (remainder) {
        case 3:
            b = (byte) (buf.get(buf.position()) ^ ((mask >> 24) & 0xff));
            buf.put(b);
            b = (byte) (buf.get(buf.position()) ^ ((mask >> 16) & 0xff));
            buf.put(b);
            b = (byte) (buf.get(buf.position()) ^ ((mask >> 8) & 0xff));
            buf.put(b);
            break;
        case 2:
            b = (byte) (buf.get(buf.position()) ^ ((mask >> 24) & 0xff));
            buf.put(b);
            b = (byte) (buf.get(buf.position()) ^ ((mask >> 16) & 0xff));
            buf.put(b);
            break;
        case 1:
            b = (byte) (buf.get(buf.position()) ^ (mask >> 24));
            buf.put(b);
            break;
        case 0:
        default:
                break;
        }
        buf.position(start);
    }
297418
def str_to_ipmask(ipmask):
    '''
    
    '''
    v = ipmask.split("/")
    if len(v) > 2: raise Exception("bad mask format")
    mask_ip = ip2hex(v[0])
    if mask_ip is None: raise Exception("bad mask format")
    mask = v[1] if len(v) == 2 else 32
    try:
        mask = (0xffffffff00000000 >> int(mask)) & 0xffffffff
    except:
        mask = ip2hex(v[1])
    
    if mask is None: raise Exception("bad mask format")
    return mask_ip, mask
43894
function _revealMasks(diff) {
    for (var i = 0; i < diff.length; i++) {
        var currPart = diff[i];

        if (!_isDiffPart(currPart)) continue;

        var prevPart = diff[i - 1],
            nextPart = diff[i + 1],
            matchedMask = currPart.value.match(MASK_REGEXP);

        if (!matchedMask) continue;

        var regExp = new RegExp('^' +
            matchedMask[1].replace(specialСhars, '\\$1') +
                matchedMask[2] +
                    matchedMask[3].replace(specialСhars, '\\$1') + '$');

        if (currPart.added && nextPart && nextPart.removed) {
            if (nextPart.value.match(regExp)) {
                nextPart.removed = undefined;
                diff.splice(i--, 1);
            }
        } else if (currPart.removed && prevPart && prevPart.added) {
            if (prevPart.value.match(regExp)) {
                prevPart.added = undefined;
                diff.splice(i--, 1);
            }
        }
    }

    return diff;
}
1143416
public static ObfuscatedData fromString(String obfuscatedString) {
        String[] parts = obfuscatedString.split("\\$");
        if (parts.length != 5) {
            throw new IllegalArgumentException("Invalid obfuscated data");
        }
        if (!parts[1].equals(SIGNATURE)) {
            throw new IllegalArgumentException("Invalid obfuscated data");
        }
        return new ObfuscatedData(Integer.parseInt(parts[2]), Base64.decode(parts[3]), Base64.decode(parts[4]));
    }
117832
private String decrypt( final String maybeEncryptedPassphrase ) {
        if (maybeEncryptedPassphrase == null) {
            return null;
        }

        try {
            final String decrypted = secDispatcher.decrypt(maybeEncryptedPassphrase);
            if (maybeEncryptedPassphrase.equals(decrypted)) {
                console.info("Passphrase was not encrypted");
            } else {
                console.info("Passphrase was successfully decrypted");
            }
            return decrypted;
        } catch (SecDispatcherException e) {
            console.warn("Unable to decrypt passphrase: " + e.getMessage());
        }

        return maybeEncryptedPassphrase;
    }
521996
private int getVertMask(int vertsCount) {
        int vertMask = Integer.highestOneBit(vertsCount);
        if (vertMask != vertsCount) {
            vertMask *= 2;
        }
        vertMask--;
        return vertMask;
    }
1211403
def mask(s = "%n!%u@%h")
      s = s.gsub(/%(.)/) {
        case $1
        when "n"
          @name
        when "u"
          self.user
        when "h"
          self.host
        when "r"
          self.realname
        when "a"
          self.authname
        end
      }

      Mask.new(s)
    end
1373130
public String getString() 
    {
        String string = super.getString();
        if ((string != null) && (string.length() > 0))
        {
            StringBuffer sb = new StringBuffer(string);
            if (sb.length() > m_iUnmaskedChars)
            {
                String strFiller = "" + FILLER;
                for (int i = 0; i < sb.length() - m_iUnmaskedChars; i++)
                {
                    sb.replace(i, i+1, strFiller);
                }
                string = sb.toString();
            }
        }
        return string;
    }