fintx-identifier

Distributed unique id generator base on ObjectId that understandable.

Лицензия

Лицензия

Категории

Категории

IDE Инструменты разработки
Группа

Группа

org.fintx
Идентификатор

Идентификатор

fintx-identifier
Последняя версия

Последняя версия

0.3.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

fintx-identifier
Distributed unique id generator base on ObjectId that understandable.
Организация-разработчик

Организация-разработчик

FinTx
Система контроля версий

Система контроля версий

https://github.com/fintx/fintx-identifier

Скачать fintx-identifier

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.fintx/fintx-identifier/ -->
<dependency>
    <groupId>org.fintx</groupId>
    <artifactId>fintx-identifier</artifactId>
    <version>0.3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.fintx/fintx-identifier/
implementation 'org.fintx:fintx-identifier:0.3.0.0'
// https://jarcasting.com/artifacts/org.fintx/fintx-identifier/
implementation ("org.fintx:fintx-identifier:0.3.0.0")
'org.fintx:fintx-identifier:jar:0.3.0.0'
<dependency org="org.fintx" name="fintx-identifier" rev="0.3.0.0">
  <artifact name="fintx-identifier" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.fintx', module='fintx-identifier', version='0.3.0.0')
)
libraryDependencies += "org.fintx" % "fintx-identifier" % "0.3.0.0"
[org.fintx/fintx-identifier "0.3.0.0"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

FinTx Identifier Generator

Maven Central GitHub release Apache 2 Join the chat at https://gitter.im/fintx/fintx-identifier Build Status Coverage Status Dependency Status

FinTx[1]

What's is FinTx?

FinTx is an open source group focus on financial technologies.

What's is fintx-identifier

fintx-identifier is for generating unique id in high performance and distribution environment. It extends the mongodb's ObjectId that using full MAC address to prevent the duplicated Id. It does not depend on the seeds like snowflake id generator. It can generate both 20 charachers base64 URL safe id (recommend) and 30 characters hex character id. Both id characters are in sequence that not random.

Structure

Consists of 15 bytes, divided as follows:

UniqueId layout
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
time machine pid counter

Limitations

  1. ProcessId on os could not bigger then 65535 (the default max value in most linux OS).
  2. Only in one bundle of same JVM when using OSGI.
  3. Id requirement could not more then about 16777215 per second per JVM.
  4. Maybe it will generate duplicated id every (2^32 - 1)/(60 * 60 * 24 * 365)≈136.19 years with same machine and same process(no possible).

Using

This is something that you get for free just by adding the following dependency inside your project:

<dependency>
    <groupId>org.fintx</groupId>
    <artifactId>fintx-identifer</artifactId>
    <version>${latest.version></version>
</dependency>

Example

  1. Get a 20 characters length unique id.
String id = UniqueId.get().toBase64String();
  1. Parse id to get timestamp, machine identifier (physical MAC address), process identifier, counter number.
UniqueId uniqueId = UniqueId.fromBase64String(id);    
long timestamp = uniqueId.getTimestamp();    
long machineId = uniqueId.getMachineIdentifier();    
int processId = uniqueId.getProcessIdentifier();    
long counter = uniqueId.getCounter();    

[1] FinTx https://www.fintx.org/
[2] Maven https://maven.apache.org/

org.fintx

FinTx

Open source group focus on financial technologies.

Версии библиотеки

Версия
0.3.0.0
0.2.0.0
0.1.0.0