Skip to content

Commit 5155ef8

Browse files
Merge branch 'release/0.3.0'
2 parents b9decf1 + 8bd1204 commit 5155ef8

File tree

13 files changed

+253
-148
lines changed

13 files changed

+253
-148
lines changed

.idea/misc.xml

Lines changed: 1 addition & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22
# title Travis CI Build Configuration +
33
# project icecore-hashids +
4-
# version +
54
# repository https://github.com/arcticicestudio/icecore-hashids +
65
# author Arctic Ice Studio +
76
8-
# copyright Copyright (C) 2016 +
7+
# copyright Copyright (C) 2017 +
98
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
109
#
1110
# [References]
@@ -20,4 +19,4 @@ cache:
2019
- $HOME/.m2
2120
after_success:
2221
- bash <(curl -s https://codecov.io/bash)
23-
script: mvn -B test -P code-coverage
22+
script: mvn -B clean verify -P code-coverage

CHANGELOG.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,48 @@
11
<p align="center"><img src="https://cdn.rawgit.com/arcticicestudio/icecore-hashids/develop/src/main/assets/icecore-hashids-logo-banner.svg"/></p>
22

3-
<p align="center"><img src="https://assets-cdn.github.com/favicon.ico" width=24 height=24/> <a href="https://github.com/arcticicestudio/icecore-hashids/releases/latest"><img src="https://img.shields.io/github/release/arcticicestudio/icecore-hashids.svg"/></a> <a href="https://github.com/arcticicestudio/icecore-hashids/releases/latest"><img src="https://img.shields.io/badge/pre--release---_-blue.svg"/></a> <img src="http://central.sonatype.org/favicon.ico" width=24 height=24/> <a href="http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.arcticicestudio%22%20AND%20a%3A%22icecore-hashids%22"><img src="https://img.shields.io/maven-central/v/com.arcticicestudio/icecore-hashids.svg"/></a> <img src="https://oss.sonatype.org/favicon.ico"/> <a href="https://oss.sonatype.org/content/repositories/snapshots/com/arcticicestudio/icecore-hashids"><img src="https://img.shields.io/badge/snapshot----blue.svg"/></a> <img src="https://bintray.com/favicon.ico" width=24 height=24/> <a href='https://bintray.com/arcticicestudio/IceCore/icecore-hashids/_latestVersion'><img src='https://api.bintray.com/packages/arcticicestudio/IceCore/icecore-hashids/images/download.svg'></a></p>
3+
<p align="center"><img src="https://assets-cdn.github.com/favicon.ico" width=24 height=24/> <a href="https://github.com/arcticicestudio/icecore-hashids/releases/latest"><img src="https://img.shields.io/github/release/arcticicestudio/icecore-hashids.svg"/></a> <img src="http://central.sonatype.org/favicon.ico" width=24 height=24/> <a href="http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.arcticicestudio%22%20AND%20a%3A%22icecore-hashids%22"><img src="https://img.shields.io/maven-central/v/com.arcticicestudio/icecore-hashids.svg"/></a> <img src="https://bintray.com/favicon.ico" width=24 height=24/> <a href='https://bintray.com/arcticicestudio/IceCore/icecore-hashids/_latestVersion'><img src='https://api.bintray.com/packages/arcticicestudio/IceCore/icecore-hashids/images/download.svg'></a> <img src="https://jitpack.io/favicon.ico"/> <a href="https://jitpack.io/v/arcticicestudio/icecore-hashids.svg"><img src="https://jitpack.io/v/arcticicestudio/icecore-hashids.svg?style=flat-square"></a></p>
44

55
---
66

7+
# 0.3.0
8+
<details>
9+
<summary>Version Details</summary>
10+
<p>
11+
Release Date: 2017-07-17<br>
12+
<a href="https://github.com/arcticicestudio/icecore-hashids/milestone/3">Milestone</a><br>
13+
<a href="https://github.com/arcticicestudio/icecore-hashids/projects/4">Project Board</a>
14+
</p>
15+
</details>
16+
17+
## Features
18+
### API
19+
❯ Implemented a non-parameter constructor as an equivalent to the default `Hashids.Builder` instance. The builder supports the creation of an Hashids instance without parameters for custom configurations, but there was no equivalent constructor for this case. (#1)
20+
21+
## Improvements
22+
### API
23+
#### Performance
24+
##### Internal
25+
❯ The private method `consistentShuffle(String,String)` now uses `char` arrays instead of `String` operations. This removes five additional `String` operations/methods and six String concatenations to three simple array assignments. (#7)
26+
27+
❯ Replaced `toCharArray(int)` methods with `charAt(int)` since `Strings` are implemented as array internally so there is no need to convert to a char array.
28+
29+
❯ Adapted to SonarQube minor rule [squid:S3400](https://sonarcloud.io/coding_rules#q=squid%3AS3400). (#5)
30+
31+
❯ Adapted to SonarQube minor rule [squid:S3400](https://sonarcloud.io/coding_rules#q=squid%3AS1643) to improve the performance. (#6)
32+
33+
### Documentation
34+
❯ Adapted to a new project setup and documentation style. (#2)
35+
36+
### Tests
37+
❯ Slighly increased the code coverage by implementation unit tests for the `Hashid` *equals* symmetric. (#8)
38+
39+
## Bug Fixes
40+
### API
41+
❯ Fixed a `ArrayIndexOutOfBoundsException` when using a invalid decode salt.
42+
43+
### JavaDoc
44+
❯ Fixed JavaDoc lint compilation errors for self-closed tags. (#3)
45+
746
# 0.2.0 (2016-06-11)
847
## Features
948
### API

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<p align="center"><img src="https://cdn.rawgit.com/arcticicestudio/icecore-hashids/develop/src/main/assets/icecore-hashids-logo-banner.svg"/></p>
22

3-
<p align="center"><img src="https://cdn.travis-ci.org/images/favicon-c566132d45ab1a9bcae64d8d90e4378a.svg" width=24 height=24/> <a href="https://travis-ci.org/arcticicestudio/icecore-hashids"><img src="https://img.shields.io/travis/arcticicestudio/icecore-hashids/develop.svg"/></a> <img src="https://circleci.com/favicon.ico" width=24 height=24/> <a href="https://circleci.com/bb/arcticicestudio/icecore-hashids"><img src="https://circleci.com/bb/arcticicestudio/icecore-hashids.svg?style=shield&circle-token=926fbd867d3c517246727a0c1486b46135483fbf"/></a> <img src="https://codecov.io/favicon.ico" width=24 height=24/> <a href="https://codecov.io/gh/arcticicestudio/icecore-hashids"><img src="https://codecov.io/gh/arcticicestudio/icecore-hashids/branch/develop/graph/badge.svg"/></a> <img src="https://assets-cdn.github.com/favicon.ico" width=24 height=24/> <a href="https://github.com/arcticicestudio/icecore-hashids/releases/latest"><img src="https://img.shields.io/github/release/arcticicestudio/icecore-hashids.svg"/></a> <a href="https://github.com/arcticicestudio/icecore-hashids/releases/latest"><img src="https://img.shields.io/badge/pre--release---_-blue.svg"/></a> <img src="http://central.sonatype.org/favicon.ico" width=24 height=24/> <a href="http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.arcticicestudio%22%20AND%20a%3A%22icecore-hashids%22"><img src="https://img.shields.io/maven-central/v/com.arcticicestudio/icecore-hashids.svg"/></a> <img src="https://oss.sonatype.org/favicon.ico"/> <a href="https://oss.sonatype.org/content/repositories/snapshots/com/arcticicestudio/icecore-hashids"><img src="https://img.shields.io/badge/snapshot----blue.svg"/></a> <img src="https://bintray.com/favicon.ico" width=24 height=24/> <a href='https://bintray.com/arcticicestudio/IceCore/icecore-hashids/_latestVersion'><img src='https://api.bintray.com/packages/arcticicestudio/IceCore/icecore-hashids/images/download.svg'></a></p>
3+
<p align="center"><img src="https://cdn.travis-ci.org/images/favicon-c566132d45ab1a9bcae64d8d90e4378a.svg" width=24 height=24/> <a href="https://travis-ci.org/arcticicestudio/icecore-hashids"><img src="https://img.shields.io/travis/arcticicestudio/icecore-hashids/develop.svg"/></a> <img src="https://circleci.com/favicon.ico" width=24 height=24/> <a href="https://circleci.com/gh/arcticicestudio/icecore-hashids"><img src="https://circleci.com/gh/arcticicestudio/icecore-hashids.svg?style=shield&circle-token=bb6fe3bab0ace13e7df7535bf914447babc98481"/></a> <img src="https://codecov.io/favicon.ico" width=24 height=24/> <a href="https://codecov.io/gh/arcticicestudio/icecore-hashids"><img src="https://codecov.io/gh/arcticicestudio/icecore-hashids/branch/develop/graph/badge.svg"/></a> <img src="https://dependencyci.com/favicon-32x32.png" width=24 height=24/> <a href="https://dependencyci.com/github/arcticicestudio/icecore-hashids"><img src="https://dependencyci.com/github/arcticicestudio/icecore-hashids/badge?style=flat-square"></a> <img src="https://assets-cdn.github.com/favicon.ico" width=24 height=24/> <a href="https://github.com/arcticicestudio/icecore-hashids/releases/latest"><img src="https://img.shields.io/github/release/arcticicestudio/icecore-hashids.svg"/></a> <a href="https://github.com/arcticicestudio/icecore-hashids/releases/latest"><img src="https://img.shields.io/badge/pre--release---_-blue.svg"/></a> <img src="http://central.sonatype.org/favicon.ico" width=24 height=24/> <a href="http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.arcticicestudio%22%20AND%20a%3A%22icecore-hashids%22"><img src="https://img.shields.io/maven-central/v/com.arcticicestudio/icecore-hashids.svg"/></a> <img src="https://oss.sonatype.org/favicon.ico"/> <a href="https://oss.sonatype.org/content/repositories/snapshots/com/arcticicestudio/icecore-hashids"><img src="https://img.shields.io/badge/snapshot-_---blue.svg"/></a> <img src="https://bintray.com/favicon.ico" width=24 height=24/> <a href="https://bintray.com/arcticicestudio/IceCore/icecore-hashids/_latestVersion"><img src="https://api.bintray.com/packages/arcticicestudio/IceCore/icecore-hashids/images/download.svg"></a> <a href="https://oss.jfrog.org/webapp/#/artifacts/browse/tree/General/oss-snapshot-local/com/arcticicestudio/icecore-hashids"><img src="https://img.shields.io/badge/artifactory-_---green.svg"/></a> <img src="https://jitpack.io/favicon.ico"/> <a href="https://jitpack.io/v/arcticicestudio/icecore-hashids.svg"><img src="https://jitpack.io/v/arcticicestudio/icecore-hashids.svg?style=flat-square"></a></p>
44

55
<p align="center">A lightweight generator for short, unique, non-sequential and decodable Hashids from positive unsigned (long) integer numbers.<br>
6-
Implementation of the [Hashids](http://hashids.org) project.</p>
6+
Implementation of the <a href="http://hashids.org">Hashids</a> project.</p>
77

88
---
99

@@ -32,18 +32,18 @@ You can use it as a dependency for your favorite build tool or [download the lat
3232
<dependency>
3333
<groupId>com.arcticicestudio</groupId>
3434
<artifactId>icecore-hashids</artifactId>
35-
<version>0.2.0</version>
35+
<version>0.3.0</version>
3636
</dependency>
3737
```
3838

3939
<img src="https://gradle.org/wp-content/uploads/fbrfg/favicon.ico" width=16 height=16/> <a href="https://gradle.org">Gradle</a>
4040
```java
41-
compile(group: 'com.arcticicestudio', name: 'icecore-hashids', version: '0.2.0')
41+
compile(group: 'com.arcticicestudio', name: 'icecore-hashids', version: '0.3.0')
4242
```
4343

4444
<img src="http://apache.org/favicons/favicon.ico" width=16 height=16/> <a href="https://ant.apache.org/ivy">Apache Ivy</a>
4545
```xml
46-
<dependency org="com.arcticicestudio" name="icecore-hashids" rev="0.2.0" />
46+
<dependency org="com.arcticicestudio" name="icecore-hashids" rev="0.3.0" />
4747
```
4848

4949
Development snapshots are available via [OSS Sonatype](https://oss.sonatype.org/content/repositories/snapshots/com/arcticicestudio/icecore-hashids).
@@ -59,13 +59,13 @@ Signed artifacts may be build by using the `sign-gpg` profile with a provided `g
5959
mvn clean install -Dgpg.keyname=YourGPGKeyId
6060
```
6161

62-
A continuous integration build is running at [Travis-CI](https://travis-ci.org/arcticicestudio/icecore-hashids) and [CircleCI](https://circleci.com/bb/arcticicestudio/icecore-hashids).
62+
Continuous integration builds are running at [Travis CI](https://travis-ci.org/arcticicestudio/icecore-hashids) and [Circle CI](https://circleci.com/bb/arcticicestudio/icecore-hashids).
6363

6464
## Usage Guide
6565
This is a basic guide to show the common usage of the icecore-hashids API.
6666
The API documentation can be found in the JavaDoc.
6767

68-
The class `Hashids` is the entrypoint to the [icecore-hashids][github-icecore-hashids] API.
68+
The class `Hashids` is the entrypoint to the icecore-hashids API.
6969

7070
1. [Encoding a number](#encoding-a-number)
7171
2. [Decoding](#decoding)
@@ -227,16 +227,17 @@ Therefore, this algorithm tries to avoid generating most common english curse wo
227227
This is done by never placing the following letters next to each other:
228228
`c, C, s, S, f, F, h, H, u, U, i, I, t, T`
229229

230+
---
231+
230232
## Development
231-
[![](https://img.shields.io/badge/Changelog-0.2.0-blue.svg)](https://github.com/arcticicestudio/icecore-hashids/blob/v0.2.0/CHANGELOG.md) [![](https://img.shields.io/badge/Workflow-gitflow_Branching_Model-blue.svg)](http://nvie.com/posts/a-successful-git-branching-model) [![](https://img.shields.io/badge/Versioning-ArcVer_0.8.0-blue.svg)](https://github.com/arcticicestudio/arcver)
233+
[![](https://img.shields.io/badge/Changelog-0.3.0-blue.svg)](https://github.com/arcticicestudio/icecore-hashids/blob/v0.3.0/CHANGELOG.md) [![](https://img.shields.io/badge/Workflow-gitflow_Branching_Model-blue.svg)](http://nvie.com/posts/a-successful-git-branching-model) [![](https://img.shields.io/badge/Versioning-ArcVer_0.8.0-blue.svg)](https://github.com/arcticicestudio/arcver)
232234

233235
### Contribution
234236
Please report issues/bugs, feature requests and suggestions for improvements to the [issue tracker](https://github.com/arcticicestudio/icecore-hashids/issues).
235237

236238
---
237239

238-
<p align="center"> <img src="http://arcticicestudio.com/favicon.ico" width=16 height=16/> Copyright &copy; 2016 Arctic Ice Studio</p>
240+
<p align="center"> <img src="http://arcticicestudio.com/favicon.ico" width=16 height=16/> Copyright &copy; 2017
241+
Arctic Ice Studio</p>
239242

240243
<p align="center"><a href="http://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg"/></a></p>
241-
242-
[github-icecore-hashids]: https://github.com/arcticicestudio/icecore-hashids

circle.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22
# title Circle CI Build Configuration +
33
# project icecore-hashids +
4-
# version +
54
# repository https://github.com/arcticicestudio/icecore-hashids +
65
# author Arctic Ice Studio +
76
8-
# copyright Copyright (C) 2016 +
7+
# copyright Copyright (C) 2017 +
98
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
109
#
1110
# [References]

icecore-hashids.iml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
3+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
44
<output url="file://$MODULE_DIR$/target/classes" />
55
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6-
<exclude-output />
76
<content url="file://$MODULE_DIR$">
87
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
98
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />

pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
44
title POM +
55
project icecore-hashids +
6-
version 0.2.0 +
76
repository https://github.com/arcticicestudio/icecore-hashids +
87
author Arctic Ice Studio +
98
10-
copyright Copyright (C) 2016 +
9+
copyright Copyright (C) 2017 +
1110
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1211
1312
[References]
@@ -28,7 +27,7 @@ JFrog Bintray
2827

2928
<groupId>com.arcticicestudio</groupId>
3029
<artifactId>icecore-hashids</artifactId>
31-
<version>0.3.0-SNAPSHOT</version>
30+
<version>0.3.0</version>
3231
<packaging>jar</packaging>
3332

3433
<name>icecore-hashids</name>

src/main/assets/assembly-bin.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
44
title Binary Assembly Descriptor +
55
project icecore-hashids +
6-
version 0.2.0 +
76
repository https://github.com/arcticicestudio/icecore-hashids +
87
author Arctic Ice Studio +
98
10-
copyright Copyright (C) 2016 +
9+
copyright Copyright (C) 2017 +
1110
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1211
-->
1312
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"

src/main/java/com/arcticicestudio/icecore/hashids/Hashid.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33
title Hashid +
44
project icecore-hashids +
5-
version 0.2.0 +
65
repository https://github.com/arcticicestudio/icecore-hashids +
76
author Arctic Ice Studio +
87
9-
copyright Copyright (C) 2016 +
8+
copyright Copyright (C) 2017 +
109
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1110
*/
1211
package com.arcticicestudio.icecore.hashids;
@@ -15,7 +14,7 @@ copyright Copyright (C) 2016 +
1514
import java.util.Objects;
1615

1716
/**
18-
* Represents a hashid which holds all numbers and the encoded string.
17+
* Represents a hashid holding all numbers and the encoded string.
1918
* <p>
2019
* <strong>This class is immutable.</strong>
2120
* </p>
@@ -29,8 +28,17 @@ public final class Hashid {
2928
private final long[] numbers;
3029
private final String hash;
3130

31+
/**
32+
* A empty hashid with no numbers and no hash.
33+
*/
3234
public static final Hashid EMPTY = new Hashid(new long[0], "");
3335

36+
/**
37+
* Constructs a new hashid with the specified numbers and hash.
38+
*
39+
* @param longs the numbers of this hashid
40+
* @param hash the hash of this hashid
41+
*/
3442
public Hashid(long[] longs, String hash) {
3543
this.numbers = longs;
3644
this.hash = hash;
@@ -48,9 +56,9 @@ public long[] numbers() {
4856
}
4957

5058
/**
51-
* Returns the hash string of this hashid
59+
* Returns the hash of this hashid.
5260
*
53-
* @return the hash string of this hashid
61+
* @return the hash of this hashid
5462
*/
5563
@Override
5664
public String toString() {

0 commit comments

Comments
 (0)