docs: public static byte[] encryptPassword(final String password, final byte[] seed,
        String passwordCharacterEncoding)
        throws NoSuchAlgorithmException, UnsupportedEncodingException {
  
      if (password == null || password.isEmpty()) {
        return new byte[0];
      }
  
      final MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
      byte[] bytePwd;
      if (passwordCharacterEncoding != null && !passwordCharacterEncoding.isEmpty()) {
        bytePwd = password.getBytes(passwordCharacterEncoding);
      } else {
        bytePwd = password.getBytes();
      }
  
      final byte[] stage1 = messageDigest.digest(bytePwd);
      messageDigest.reset();
  
      final byte[] stage2 = messageDigest.digest(stage1);
      messageDigest.reset();
  
      messageDigest.update(seed);
      messageDigest.update(stage2);
  
      final byte[] digest = messageDigest.digest();
      final byte[] returnBytes = new byte[digest.length];
      for (int i = 0; i < digest.length; i++) {
        returnBytes[i] = (byte) (stage1[i] ^ digest[i]);
      }
      return returnBytes;
    }