code: public static byte[] convertStringSidToBinary(String string) {
  		String[] parts = string.split("-");
  		byte sidRevision = (byte) Integer.parseInt(parts[1]);
  		int subAuthCount = parts.length - 3;
  
          byte[] sid = new byte[] {sidRevision, (byte) subAuthCount};
  		sid = addAll(sid, numberToBytes(parts[2], 6, true));
  		for (int i = 0; i < subAuthCount; i++) {
  			sid = addAll(sid, numberToBytes(parts[3 + i], 4, false));
  		}
  		return sid;
  	}
docs: Converts a String SID to its binary representation, according to the
  algorithm described <a
  href="https://blogs.msdn.com/oldnewthing/archive/2004/03/15/89753.aspx"
  >here</a>.
  
  @param string SID in readable format
  @return Binary version of the given sid
  @see LdapUtils#convertBinarySidToString(byte[])
  @since 1.3.1