Examples of asHex()


Examples of com.github.eclipsecolortheme.Color.asHex()

    @Test
    public void getColor() {
        Color color = setting.getColor();
        assertThat(color, notNullValue());
        assertThat(color.asHex(), is("#00FFAA"));
    }

    @Test
    public void decorationBold() {
        setting.setBoldEnabled(true);
View Full Code Here

Examples of com.knowgate.misc.MD5.asHex()

    long lNow = new Date().getTime();
    if (lTimestamp+lTimeout<lNow) {
      iRetVal = CAPTCHA_TIMEOUT;
    } else {
      MD5 oCaptchaMd5 = new MD5(sPlainCaptcha+ACL.getRC4key());
      if (sPlainCaptchaMD5.equalsIgnoreCase(oCaptchaMd5.asHex()))
      iRetVal = (short) 0;
    else
        iRetVal = CAPTCHA_MISMATCH;
    } // fi (lTimestamp+lCaptchaTimeout<lNow)
    return iRetVal;
View Full Code Here

Examples of com.knowgate.misc.MD5.asHex()

  @ValidationMethod(on="save")
  public void validate(ValidationErrors errors) {

    MD5 oMD5 = new MD5(getCaptcha()+ACL.getRC4key());

    if (!oMD5.asHex().equals(getSessionAttribute("captcha_key")) && false) {

      try {
        connect();
        DAO.log(getSession(), user.getClass(), "CAPTCHA MISMATCH", AtrilEvent.Level.WARNING, ";"+user.getEmail());
        disconnect();
View Full Code Here

Examples of com.knowgate.misc.MD5.asHex()

        connect();
        DAO.log(getSession(), user.getClass(), "CAPTCHA MISMATCH", AtrilEvent.Level.WARNING, ";"+user.getEmail());
        disconnect();
      } catch (StorageException ignore) { }

      Log.out.warn("Captch mismatch: signature "+oMD5.asHex()+" for text "+getCaptcha()+" does not match session signature "+getSessionAttribute("captcha_key"));

      errors.add("captcha", new LocalizableError("com.zesped.action.SignUpForm.captchaMismatch"));      

    } else {
   
View Full Code Here

Examples of com.twmacinta.util.MD5.asHex()

        md5.Update(cid, ENCODING);
        if (log.isDebugEnabled()) {
          toHash.append(cid);
        }
      }
      String key = md5.asHex();
      if (log.isDebugEnabled()) {
        log.debug("key for context {} which is a hash for {}", key, forceAscii(toHash));
      }
      return key;
    } catch (UnsupportedEncodingException uee) {
View Full Code Here

Examples of com.twmacinta.util.MD5.asHex()

        {
      // Fast MD5 by Timothy W Macinta
      // http://www.twmacinta.com/myjava/fast_md5.php
            MD5 md5 = new MD5();
            md5.Update(s);
            s1 = md5.asHex();
        }
        catch(Exception exception)
        {
            System.out.println(exception);
        }
View Full Code Here

Examples of com.twmacinta.util.MD5.asHex()

    if (admin == null) {
      admin = new User();
      admin.setUsername("admin");
      MD5 md5 = new MD5();
      md5.Update("p@$$w0rd");
      admin.setPasswordHash(md5.asHex());
      admin.setFirstname("Admin");
      admin.setLastname("Istrator");
      admin.setPasswordHint("default");
      admin.setEmail("admin@domain.com");
      admin.setSignupDate(System.currentTimeMillis());
View Full Code Here

Examples of com.twmacinta.util.MD5.asHex()

    if (anonymous == null) {
      anonymous = new User();
      anonymous.setUsername("anonymous");
      MD5 md5 = new MD5();
      md5.Update("s,!5C6xAwM");
      anonymous.setPasswordHash(md5.asHex());
      anonymous.setFirstname("anonymous");
      anonymous.setLastname("anonymous");
      anonymous.setPasswordHint("default");
      anonymous.setSignupDate(System.currentTimeMillis());
      anonymous.setAdministrator(false);
View Full Code Here

Examples of com.twmacinta.util.MD5.asHex()

  @Test
  public void passwordHashTest() {
    String password = "t@k30ff";
    MD5 md5 = new MD5();
    md5.Update(password);
    String hash1 = md5.asHex();
    md5 = new MD5();
    md5.Update(password);
    String hash2 = md5.asHex();
    assertEquals(hash1, hash2);
    System.out.println(hash1);
View Full Code Here

Examples of com.twmacinta.util.MD5.asHex()

    MD5 md5 = new MD5();
    md5.Update(password);
    String hash1 = md5.asHex();
    md5 = new MD5();
    md5.Update(password);
    String hash2 = md5.asHex();
    assertEquals(hash1, hash2);
    System.out.println(hash1);
  }

  public void after() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.