class GlobalIdentifier {

  public static String toString(final byte[] guid)
  {
    // CheckStyle:MagicNumber OFF

    // create a byte buffer for reading the guid
    final ByteBuffer guidBuffer = ByteBuffer.wrap(guid);

    // string identifier
    final StringBuilder sb = new StringBuilder("{");
    // encode the first 4 bytes, big endian
    guidBuffer.limit(4);
    sb.append(LdapUtils.hexEncode(getBytes(guidBuffer, true)));

    // encode the next 2 bytes, big endian
    guidBuffer.limit(6);
    sb.append("-").append(LdapUtils.hexEncode(getBytes(guidBuffer, true)));

    // encode the next 2 bytes, big endian
    guidBuffer.limit(8);
    sb.append("-").append(LdapUtils.hexEncode(getBytes(guidBuffer, true)));

    // encode the next 2 bytes, little endian
    guidBuffer.limit(10);
    sb.append("-").append(LdapUtils.hexEncode(getBytes(guidBuffer, false)));

    // encode the last 6 bytes, little endian
    guidBuffer.limit(guidBuffer.capacity());
    sb.append("-").append(LdapUtils.hexEncode(getBytes(guidBuffer, false)));
    sb.append("}");

    return sb.toString();
    // CheckStyle:MagicNumber ON
  }

  private  GlobalIdentifier();

}