Skip to content

Instantly share code, notes, and snippets.

@aVolpe
Created April 22, 2014 13:53
Show Gist options
  • Select an option

  • Save aVolpe/11180125 to your computer and use it in GitHub Desktop.

Select an option

Save aVolpe/11180125 to your computer and use it in GitHub Desktop.
LdapPassword Builder
String ldapPasswordEncoder(String string) {
Charset cs = Charset.forName(CharEncoding.UTF_8);
StringBuilder builder = new StringBuilder("{MD5}");
builder.append(new String(Base64.encode(DigestUtils.md5Digest(string
.getBytes(cs)))));
return builder.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment