List of utility methods to do ID Generate
String | generateSyncEventId() generate Sync Event Id if (sequence == Long.MAX_VALUE) sequence = 0; return convertLongToDateString(System.currentTimeMillis(), "yyyy-MM-dd hh:mm:ss") + "-" + String.format("%20d", sequence++); |
String | getSequenceId() get Sequence Id String mark = String.valueOf(System.currentTimeMillis());
return mark;
|
long | generateId(Object... value) generate Id try { StringBuilder builder = new StringBuilder(); for (Object s : value) { builder.append(String.valueOf(s)); MessageDigest md = MessageDigest.getInstance("sha-1"); md.update(builder.toString().getBytes()); byte[] hashValBytes = md.digest(); ... |
long | generateId(Object... value) generate Id if (md == null) { return 0L; StringBuilder builder = new StringBuilder(); for (Object s : value) { builder.append(String.valueOf(s)); byte[] hashValBytes; ... |
String | generateRecordingIdentifier() generate Recording Identifier return UUID.randomUUID().toString();
|
String | getAndroidId(Context context) get Android Id String androidId = android.provider.Settings.Secure.getString( context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); if (androidId != null) return getHash(androidId); return null; |
String | generateKey() generate Key SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd-HH-mm-ss-SSS"); return simpleDateFormat.format(Calendar.getInstance().getTime()); |
String | generateRandomUIID() generate Random UIID UUID uniqueKey = UUID.randomUUID();
return uniqueKey.toString();
|