Skip to content

Instantly share code, notes, and snippets.

@aVolpe
Created April 22, 2014 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aVolpe/11180125 to your computer and use it in GitHub Desktop.
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