/*
Documented, #uniquePassword
436362
public static String uniquePassword() {
        final String[] passwords = new String[] {
            "ALKJVBPIQYTUIWEBVPQALZVKQRWORTUYOYISHFLKAJMZNXBVMNFGAHKJSDFALAPOQIERIUYTGSFGKMZNXBVJAHGFAKX",
            "1234567890",
            "qpowiealksdjzmxnvbfghsdjtreiuowiruksfhksajmzxncbvlaksjdhgqwetytopskjhfgvbcnmzxalksjdfhgbvzm",
            ".@,-+/()#$%^&*!"
        };
        final StringBuilder result = new StringBuilder();
        final long passwordLength = Math.abs(UUID.randomUUID().getLeastSignificantBits() % MIN_PASSWORD_LENGTH_8)
            + MIN_PASSWORD_LENGTH_8;
        for (int index = 0; index < passwordLength; index += 1) {
            final int passIndex = (int) (passwords.length * (long) index / passwordLength);
            final int charIndex = (int) Math.abs(
                UUID.randomUUID().getLeastSignificantBits() % passwords[passIndex].length());
            result.append(passwords[passIndex].charAt(charIndex));
        }
        return result.toString();
    }
649504
@Override
	public final Key keyFromPassword(char[] password) {
		try {
			SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
			int keyLength = Math.min(Cipher.getMaxAllowedKeyLength(algorithm), maximumKeyLength);
			KeySpec spec = new PBEKeySpec(password, salt, iterationCount, keyLength);
			SecretKey tmp = factory.generateSecret(spec);
			return new SecretKeySpec(tmp.getEncoded(), algorithm);
		} catch (NoSuchAlgorithmException e) {
			throw new RuntimeException(e);
		} catch (InvalidKeySpecException e) {
			throw new RuntimeException(e);
		}
	}
20553
public static AuthInfo typical(String username, String password) {
    return new AuthInfo(new PlainCallbackHandler(username, password),
        new String[] {"CRAM-MD5", "PLAIN"});
  }
1147514
function hashPassword (data) {
  var password = data.password
  var hash = data.hash

  if (password) {
    var salt = bcrypt.genSaltSync(10)
    hash = bcrypt.hashSync(password, salt)
  }

  this.hash = hash
}
1257874
private String _getUniqueKey()
	{
		StringBuilder b = new StringBuilder();
		b.append( service );
		b.append( "#" );
		b.append( method );
		if( params != null )
		{
			b.append( "#" );
			b.append( params.toString() );
		}

		return b.toString();
	}
1097937
private String getSecNameFromUniqueID(String uniqueId) throws WIMException {
        String METHODNAME = "getSecNameFromUniqueID";
        String secName = null;
        try {
            secName = getUserSecurityName(uniqueId);
        } catch (EntryNotFoundException e) {
            try {
                secName = getGroupSecurityName(uniqueId);
            } catch (com.ibm.ws.security.registry.EntryNotFoundException renf) {
                throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                                   WIMMessageHelper.generateMsgParms(uniqueId)));
            } catch (RegistryException re) {
                throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                                   WIMMessageHelper.generateMsgParms(uniqueId)));
            }
        } catch (RegistryException e) {
            throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                               WIMMessageHelper.generateMsgParms(uniqueId)));
        }

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, METHODNAME + " The Security Name for " + uniqueId + " is " + secName);
        }

        return secName;
    }
217157
private JCheckBox getChkShowPassword() {
		if (chkShowPassword == null) {
			chkShowPassword = new JCheckBox();
			chkShowPassword.setText(Constant.messages.getString("conn.options.proxy.auth.showpass"));
			chkShowPassword.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    
					if (chkShowPassword.isSelected()) {
						txtProxyChainPassword.setEchoChar((char) 0);
			        } else {
			        	txtProxyChainPassword.setEchoChar('*');
			        }
				}
			});

		}
		return chkShowPassword;
	}
16655
public StorableIndex<S> unique(boolean unique) {
        if (unique == mUnique) {
            return this;
        }
        return new StorableIndex<S>(mProperties, mDirections, unique, mClustered, false);
    }
946192
public Mapper<K, V> uniqueKey() {
		return addConstraint(new Restraint<K, V>() {
			
			@Override
			public void checkKeyValue(K key, V value) {
				checkArgument(!delegate.get().containsKey(key), "The key: %s is already exist.", key);
			}
		});
	}
780448
public static function isUniqueIdValid($uniqueId, $class)
    {
        if (!$uniqueId) {
            throw new InvalidArgumentException(sprintf(
                __('For the service provider [%s], the container unique ID cannot be empty.', 'fulcrum'),
                $class
            ));
        }

        if (!is_string($uniqueId)) {
            throw new InvalidArgumentException(sprintf(
                __('For the service provider [%s], the container unique ID must be a string. %s given.', 'fulcrum'),
                $class,
                gettype($uniqueId)
            ));
        }

        return true;
    }
997029
private static function unique_key() {
		if ( ! function_exists( 'random_int' ) ) {
			throw new Exception( "'random_int' does not exist" );
		}

		$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|';
		$key   = '';

		for ( $i = 0; $i < 64; $i++ ) {
			// phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.random_intFound -- Will be called only if function exists.
			$key .= substr( $chars, random_int( 0, strlen( $chars ) - 1 ), 1 );
		}

		return $key;
	}
981567
public ParallelTaskBuilder setSshPassword(String password) {
        this.sshMeta.setPassword(password);
        this.sshMeta.setSshLoginType(SshLoginType.PASSWORD);
        return this;
    }
292760
private boolean doUserPasswordAuthentication(Socket s,
                                                InputStream in,
                                                OutputStream out) 
                                                throws IOException{
     int version = in.read();
     if(version != 1) return false;
     int ulen = in.read();
     if(ulen < 0) return false;
     byte[] user = new byte[ulen];
     in.read(user);
     int plen = in.read();
     if(plen < 0) return false;
     byte[] password = new byte[plen];
     in.read(password);

     if(validator.isUserValid(new String(user), new String(password),s)){
       //System.out.println("user valid");
       out.write(new byte[]{1,0});
     }else{
       //System.out.println("user invalid");
       out.write(new byte[]{1,1});
       return false;
     }

     return true;
   }
194518
function SigCacheEntry(sig, key) {
  this.sig = Buffer.from(sig);
  this.key = Buffer.from(key);
}
33781
function ( src )
	{
		// A faster unique method is to use object keys to identify used values,
		// but this doesn't work with arrays or objects, which we must also
		// consider. See jsperf.com/compare-array-unique-versions/4 for more
		// information.
		var
			out = [],
			val,
			i, ien=src.length,
			j, k=0;
	
		again: for ( i=0 ; i<ien ; i++ ) {
			val = src[i];
	
			for ( j=0 ; j<k ; j++ ) {
				if ( out[j] === val ) {
					continue again;
				}
			}
	
			out.push( val );
			k++;
		}
	
		return out;
	}
813310
public static String getUniqueKey(final ErrorItem errorItem) {
		if (errorItem == null) {
			throw new NullPointerException("ErrorItem is null");
		}
		
		String type = errorItem.getErrorType();
    	String typeCode = errorItem.getErrorTypeCode();
    	String method = errorItem.getSourceMethod();

    	String uniqueKey = String.format("%s-%s-%s", type, typeCode, method);
    	
    	return MessageDigests.md5Hex(uniqueKey);
    }
860688
function hasDuplicateDependentKeys(callExp) {
  if (!isComputedProp(callExp)) return false;

  const dependentKeys = parseDependentKeys(callExp);
  const uniqueKeys = dependentKeys
    .filter((val, index, self) => self.indexOf(val) === index);

  return uniqueKeys.length !== dependentKeys.length;
}