Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticicestudio committed Jul 17, 2017
2 parents b9decf1 + 8bd1204 commit 5155ef8
Show file tree
Hide file tree
Showing 13 changed files with 253 additions and 148 deletions.
31 changes: 1 addition & 30 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# title Travis CI Build Configuration +
# project icecore-hashids +
# version +
# repository https://github.com/arcticicestudio/icecore-hashids +
# author Arctic Ice Studio +
# email [email protected] +
# copyright Copyright (C) 2016 +
# copyright Copyright (C) 2017 +
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# [References]
Expand All @@ -20,4 +19,4 @@ cache:
- $HOME/.m2
after_success:
- bash <(curl -s https://codecov.io/bash)
script: mvn -B test -P code-coverage
script: mvn -B clean verify -P code-coverage
41 changes: 40 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
<p align="center"><img src="https://cdn.rawgit.com/arcticicestudio/icecore-hashids/develop/src/main/assets/icecore-hashids-logo-banner.svg"/></p>

<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>
<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>

---

# 0.3.0
<details>
<summary>Version Details</summary>
<p>
Release Date: 2017-07-17<br>
<a href="https://github.com/arcticicestudio/icecore-hashids/milestone/3">Milestone</a><br>
<a href="https://github.com/arcticicestudio/icecore-hashids/projects/4">Project Board</a>
</p>
</details>

## Features
### API
❯ 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)

## Improvements
### API
#### Performance
##### Internal
❯ 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)

❯ 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.

❯ Adapted to SonarQube minor rule [squid:S3400](https://sonarcloud.io/coding_rules#q=squid%3AS3400). (#5)

❯ Adapted to SonarQube minor rule [squid:S3400](https://sonarcloud.io/coding_rules#q=squid%3AS1643) to improve the performance. (#6)

### Documentation
❯ Adapted to a new project setup and documentation style. (#2)

### Tests
❯ Slighly increased the code coverage by implementation unit tests for the `Hashid` *equals* symmetric. (#8)

## Bug Fixes
### API
❯ Fixed a `ArrayIndexOutOfBoundsException` when using a invalid decode salt.

### JavaDoc
❯ Fixed JavaDoc lint compilation errors for self-closed tags. (#3)

# 0.2.0 (2016-06-11)
## Features
### API
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<p align="center"><img src="https://cdn.rawgit.com/arcticicestudio/icecore-hashids/develop/src/main/assets/icecore-hashids-logo-banner.svg"/></p>

<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>
<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>

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

---

Expand Down Expand Up @@ -32,18 +32,18 @@ You can use it as a dependency for your favorite build tool or [download the lat
<dependency>
<groupId>com.arcticicestudio</groupId>
<artifactId>icecore-hashids</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
</dependency>
```

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

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

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

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).
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).

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

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

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

---

## Development
[![](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)
[![](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)

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

---

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

<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>

[github-icecore-hashids]: https://github.com/arcticicestudio/icecore-hashids
3 changes: 1 addition & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# title Circle CI Build Configuration +
# project icecore-hashids +
# version +
# repository https://github.com/arcticicestudio/icecore-hashids +
# author Arctic Ice Studio +
# email [email protected] +
# copyright Copyright (C) 2016 +
# copyright Copyright (C) 2017 +
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# [References]
Expand Down
3 changes: 1 addition & 2 deletions icecore-hashids.iml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title POM +
project icecore-hashids +
version 0.2.0 +
repository https://github.com/arcticicestudio/icecore-hashids +
author Arctic Ice Studio +
email [email protected] +
copyright Copyright (C) 2016 +
copyright Copyright (C) 2017 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[References]
Expand All @@ -28,7 +27,7 @@ JFrog Bintray

<groupId>com.arcticicestudio</groupId>
<artifactId>icecore-hashids</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.3.0</version>
<packaging>jar</packaging>

<name>icecore-hashids</name>
Expand Down
3 changes: 1 addition & 2 deletions src/main/assets/assembly-bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title Binary Assembly Descriptor +
project icecore-hashids +
version 0.2.0 +
repository https://github.com/arcticicestudio/icecore-hashids +
author Arctic Ice Studio +
email [email protected] +
copyright Copyright (C) 2016 +
copyright Copyright (C) 2017 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
Expand Down
18 changes: 13 additions & 5 deletions src/main/java/com/arcticicestudio/icecore/hashids/Hashid.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title Hashid +
project icecore-hashids +
version 0.2.0 +
repository https://github.com/arcticicestudio/icecore-hashids +
author Arctic Ice Studio +
email [email protected] +
copyright Copyright (C) 2016 +
copyright Copyright (C) 2017 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
package com.arcticicestudio.icecore.hashids;
Expand All @@ -15,7 +14,7 @@ copyright Copyright (C) 2016 +
import java.util.Objects;

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

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

/**
* Constructs a new hashid with the specified numbers and hash.
*
* @param longs the numbers of this hashid
* @param hash the hash of this hashid
*/
public Hashid(long[] longs, String hash) {
this.numbers = longs;
this.hash = hash;
Expand All @@ -48,9 +56,9 @@ public long[] numbers() {
}

/**
* Returns the hash string of this hashid
* Returns the hash of this hashid.
*
* @return the hash string of this hashid
* @return the hash of this hashid
*/
@Override
public String toString() {
Expand Down
Loading

0 comments on commit 5155ef8

Please sign in to comment.