Returns pure String representation of the ID in hexadecimal. This method should be used to construct things like
paths etc., that require a stable representation and is therefore final.
974001
public final String toHexString() {
		if (this.hexString == null) {
			final byte[] ba = new byte[SIZE];
			longToByteArray(this.lowerPart, ba, 0);
			longToByteArray(this.upperPart, ba, SIZE_OF_LONG);

			this.hexString = StringUtils.byteToHexString(ba);
		}

		return this.hexString;
	}
1170544
public static String generateRequestId() {
        /* compute a random 256-bit string and hex-encode it */
        final SecureRandom sr = new SecureRandom();
        final byte[] bytes = new byte[32];
        sr.nextBytes(bytes);
        return hexEncode(bytes);
    }
910955
@SuppressWarnings("checkstyle:BooleanExpressionComplexity")
    public static String encodeID(final String aID) {
        Objects.requireNonNull(aID, LOGGER.getMessage(MessageCodes.PT_004));

        final byte[] bytes;

        try {
            bytes = aID.getBytes("utf-8");
        } catch (final UnsupportedEncodingException details) {
            throw new PairtreeRuntimeException(MessageCodes.PT_008, details);
        }

        final StringBuffer idBuffer = new StringBuffer();

        for (final byte b : bytes) {
            final int i = b & 0xff;

            if (i < 0x21 || i > 0x7e || i == 0x22 || i == 0x2a || i == 0x2b || i == 0x2c || i == 0x3c ||
                    i == 0x3d || i == 0x3e || i == 0x3f || i == 0x5c || i == 0x5e || i == 0x7c) {
                // Encode
                idBuffer.append(HEX_INDICATOR);
                idBuffer.append(Integer.toHexString(i));
            } else {
                // Don't encode
                final char[] chars = Character.toChars(i);

                assert chars.length == 1;
                idBuffer.append(chars[0]);
            }
        }

        for (int index = 0; index < idBuffer.length(); index++) {
            final char character = idBuffer.charAt(index);

            // Encode characters that need to be encoded according to Pairtree specification
            if (character == PATH_SEP) {
                idBuffer.setCharAt(index, EQUALS_SIGN);
            } else if (character == COLON) {
                idBuffer.setCharAt(index, PLUS_SIGN);
            } else if (character == PERIOD) {
                idBuffer.setCharAt(index, COMMA);
            }
        }

        return idBuffer.toString();
    }
725456
def id(self):
        
        h = hashlib.new('sha512')
        for value in (self.machine.name, self.machine.os, self.user, self.application.name,
                      self.application.path, self.event.report_type, self.event.type,
                      self.event.time.isoformat()):
            h.update(str(value).encode('utf-8'))
        for parameter in sorted(self.parameters, key=lambda k: getattr(k, 'id')):
            h.update(parameter.value.encode('utf-8'))
        return h.hexdigest()
193803
public String getIdValue(final URI id) {
        if (id == null) {
            return null;
        }
        final URI localId = id.normalize();
        return idMap.get(localId);
    }
474920
private String stringId() throws RecognitionException {
        if ( input.LA( 1 ) == DRL5Lexer.ID ) {
            Token id = match( input,
                              DRL5Lexer.ID,
                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            return id.getText();
        } else if ( input.LA( 1 ) == DRL5Lexer.STRING ) {
            Token id = match( input,
                              DRL5Lexer.STRING,
                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            return StringUtils.unescapeJava( safeStripStringDelimiters( id.getText() ) );
        } else {
            throw new MismatchedTokenException( DRL5Lexer.ID,
                                                input );
        }
    }
200806
String getStringByID(long stringID) {
        Long stringIDObj = new Long(stringID);
        String string = (String) stringCache.get(stringIDObj);
        if (string == null) {
            string = createStringByID(stringID);
            stringCache.put(stringIDObj,string);
        }
        return string;
    }
465104
@Override
    public String getId(Map<String, Object> context) {
        String id = null;

        if (isMultiplexWithAddress()) {
            String address = (String) context.get(Message.PATH_INFO);
            if (null != address) {
                int afterLastSlashIndex = address.lastIndexOf("/") + 1;
                if (afterLastSlashIndex > 0
                    && afterLastSlashIndex < address.length()) {
                    id = address.substring(afterLastSlashIndex);
                }
            } else {
                getLogger().log(Level.WARNING,
                                new org.apache.cxf.common.i18n.Message("MISSING_PATH_INFO", tc.getLogger()).toString());
            }
        } else {
            return super.getId(context);
        }
        return id;
    }
83717
public final String getCorrelationId() {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getCorrelationId");

        String value = null;
        int choice = getApi().getChoiceField(JsApiAccess.CORRELATIONID);

        /* If it is stored as a String, just extract it */
        if (choice == JsApiAccess.IS_CORRELATIONID_STRINGVALUE) {
            value = (String) getApi().getField(JsApiAccess.CORRELATIONID_STRINGVALUE);
        }

        /* If it is stored as a binary, we have to convert it */
        else if (choice == JsApiAccess.IS_CORRELATIONID_BINARYVALUE) {
            byte[] binValue = (byte[]) getApi().getField(JsApiAccess.CORRELATIONID_BINARYVALUE);

            if (binValue != null) {
                /* It'll be more economical to get the length right immediately */
                StringBuffer sbuf = new StringBuffer((binValue.length * 2) + 3);

                /* Insert the ID: then add on the binary value as a hex string */
                sbuf.append(ID_STRING);
                HexString.binToHex(binValue, 0, binValue.length, sbuf);

                /* Return the String representation */
                value = sbuf.toString();
            }

        }

        /* If the choice was 'Empty' do nothing as value is already null. */

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getCorrelationId", value);

        return value;
    }
1159134
public static byte[] stringToId(final String branch_id) {
    if (branch_id == null || branch_id.isEmpty()) {
      throw new IllegalArgumentException("Branch ID was empty");
    }
    if (branch_id.length() < 4) {
      throw new IllegalArgumentException("Branch ID was too short");
    }
    String id = branch_id;
    if (id.length() % 2 != 0) {
      id = "0" + id;
    }
    return DatatypeConverter.parseHexBinary(id);
  }
1312720
public final String getIdColumnsString() {
    StringBuffer sb = new StringBuffer("");
    for (int i = 0; i < this.idColumnsNames.length; i++) {
      if (i > 0) {
        sb.append(",");
      }
      sb.append(this.idColumnsNames[i]);
    }
    return sb.toString();
  }
395336
private String _getIdFromClientId(String clientId)
  {
    final char separator = getFacesContext().getNamingContainerSeparatorChar();
    int lastIndex = clientId.lastIndexOf(separator);

    String id = null;

    if (lastIndex < 0)
    {
      id = clientId;
    }
    else if (lastIndex < (clientId.length() - 1))
    {
      id = clientId.substring(lastIndex + 1);              
    }
    //else
    //{
      // TODO log warning for trailing colon case
    //}
 
    return id;
  }
812802
final String debugId(long id) {
    byte[] buf = new byte[8];
    ArrayUtil.writeLong(buf, 0, id);
    return HexUtil.toString(buf);
  }
946856
public static String randomUUID() {

        String base = CmsUUID.getNullUUID().toString();
        String hexDigits = "0123456789abcdef";
        StringBuffer result = new StringBuffer();
        for (int i = 0; i < base.length(); i++) {
            char ch = base.charAt(i);
            if (ch == '-') {
                result.append(ch);
            } else if (ch == '0') {
                result.append(hexDigits.charAt(Random.nextInt(16)));
            }
        }
        return result.toString();
    }
498470
public String toHexString() {
    final StringBuilder buf = new StringBuilder(24);

    for (final byte b : toByteArray()) {
      buf.append(String.format("%02x", b & 0xff));
    }

    return buf.toString();
  }
261067
private static String getHexString(byte[] bytes) {

        // If null byte array given, return null
        if (bytes == null)
            return null;

        // Create string builder for holding the hex representation,
        // pre-calculating the exact length
        StringBuilder hex = new StringBuilder(2 * bytes.length);

        // Convert each byte into a pair of hex digits
        for (byte b : bytes) {
            hex.append(HEX_CHARS[(b & 0xF0) >> 4])
               .append(HEX_CHARS[ b & 0x0F      ]);
        }

        // Return the string produced
        return hex.toString();

    }
1180031
function makeObjectID() {
    return hexString(8, Date.now() / 1000) +
        hexString(6, machineId) +
        hexString(4, processId) +
        hexString(6, counter++); // a 3-byte counter, starting with a random value.
}