longmapper

A family of bijective mappings for 64-bit integers.

Лицензия

Лицензия

Группа

Группа

com.codahale
Идентификатор

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

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

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

0.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

longmapper
A family of bijective mappings for 64-bit integers.
Ссылка на сайт

Ссылка на сайт

https://github.com/codahale/longmapper
Система контроля версий

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

https://github.com/codahale/longmapper

Скачать longmapper

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

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

Зависимости

test (8)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-api jar 5.3.1
org.junit.jupiter : junit-jupiter-engine jar 5.3.1
org.junit.jupiter : junit-jupiter-params jar 5.3.1
org.assertj : assertj-core jar 3.11.1
org.quicktheories : quicktheories jar 0.25
org.mockito : mockito-core jar 2.22.0
org.openjdk.jmh : jmh-core jar 1.21
org.openjdk.jmh : jmh-generator-annprocess jar 1.21

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

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

LongMapper

CircleCI

Add to your project

<dependency>
  <groupId>com.codahale</groupId>
  <artifactId>longmapper</artifactId>
  <version>0.1.1</version>
</dependency>

Note: module name for Java 9+ is com.codahale.longmapper.

Use the thing

import static java.nio.charset.StandardCharsets.UTF_8;
import com.codahale.longmapper.LongMapper;

class Example {
  public static void main(String... args) {
    final LongMapper mapper = new LongMapper("ayellowsubmarine".getBytes(UTF_8));

    System.out.printf("Mapped %d to %d\n", 200, mapper.map(200));
    System.out.printf("Unmapped %d to %d\n", mapper.map(200), mapper.unmap(mapper.map(200)));
  }
}

How it works

It encrypts each long as a 64-bit Blowfish block.

Performance

It's fast. Plenty fast.

Benchmark         Mode  Cnt    Score   Error  Units
Benchmarks.map    avgt   20  102.132 ± 8.190  ns/op
Benchmarks.unmap  avgt   20  115.311 ± 1.092  ns/op

License

Copyright © 2018 Coda Hale

Distributed under the Apache License 2.0.

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

Версия
0.1.1
0.1.0