Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

arthurbergmz/hashids-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hashids-java

Unofficial version, in Java, of Hashids v1.0.2, by Ivan Akimov.

There's already a Java version of Hashids, but my version is faster and lighter. I made some benchmarking with JBenchX, you can see the results below, using a method like this one, running for(int i = 0; i <= x; i++), encoding and decoding i:

    @Bench
	public void benchmark(@ForEachInt({100,1000,10000,100000}) int x){
		for(int i = 0; i <= x; i++){
			this.decode(this.encode(i));
		}
	}
  • Benchmarks:

    • 1. where x = 100: (101 elements)

      alt tag

    • 2. where x = 1000: (1001 elements)

      alt tag

    • 3. where x = 10000: (10001 elements)

      alt tag

    • 4. where x = 100000: (100001 elements)

      alt tag

About

Faster and unofficial version, in Java, of Hashids, by Ivan Akimov

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages