MicroISRC is a Java library designed to generate valid ISRCs using your purchased prefixes (Country Code + Registrant
Code) for any year.
MicroISRC is hosted on the JitPack package repository which supports Gradle, Maven, and sbt.
Add JitPack to your build.gradle at the end of repositories.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add MicroISRC as a dependency.
dependencies {
implementation 'com.github.Valkryst:MicroISRC:1.1.0'
}
Add JitPack as a repository.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>Add MicroISRC as a dependency.
<dependency>
<groupId>com.github.Valkryst</groupId>
<artifactId>MicroISRC</artifactId>
<version>1.1.0</version>
</dependency>Add JitPack as a resolver.
resolvers += "jitpack" at "https://jitpack.io"
Add MicroISRC as a dependency.
libraryDependencies += "com.github.Valkryst" % "MicroISRC" % "1.1.0"
This library has been designed in such a way as to make it agnostic of the backend storage required to enable its use.
To use MicroISRC you must first write a class which implements the ISRCRepository
interface, then you can initialize and use the ISRCGenerator
as follows:
import com.valkryst.MicroISRC.ISRCGenerator;
import com.valkryst.MicroISRC.repository.ISRCRepository;
import java.time.Year;
import java.time.ZoneId;
public class Example {
public static void main(final String[] args) {
final ISRCRepository repository = null; // Initialize this using your implementation of ISRCRepository.
final ISRCGenerator generator = ISRCGenerator.getInstance();
generator.setRepository(repository);
final Year currentYear = Year.of(ZoneId.systemDefault());
System.out.println(generator.generate(currentYear));
}
}Implementations of ISRCRepository must adhere to the documentation of the interface and its methods, with special
care required to ensure the methods are atomic and thread-safe. An example can be found here.


