Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.
/ skgl-kotlin Public archive

SKGL ported from C#. Generate & validate human readable, 20-character serial keys with up to 8 features embedded.

License

Notifications You must be signed in to change notification settings

ravindUwU/skgl-kotlin

Repository files navigation

SKGL (Kotlin)

The SKGL library, written in Kotlin, with a shiny new API. Use this to generate & validate human readable, 20-character serial keys with up to 8 features embedded.


Usage

import dev.ravindu.skgl.SerialKey

Generate a Key

val key = SerialKey.build("a-secret") {
	features = setOf(1, 3, 5)
	duration = 10
	chunked = true
}

println(key.text) // XXXXX-XXXXX-XXXXX-XXXXX

Decode a Key

val key = SerialKey("XXXXX-XXXXX-XXXXX-XXXXX", "a-secret")

val createdOn = key.createdOn
val expiresOn = key.expiresOn
val hasFeature1 = 1 in key.features
val isExpired = key.calculateIsExpired()
val daysLeft = key.calculateDaysLeft()

UI

The TornadoFX-powered skgl-ui project can be used to generate or validate keys,

About

Generate

Validate

About

SKGL ported from C#. Generate & validate human readable, 20-character serial keys with up to 8 features embedded.

Topics

Resources

License

Stars

Watchers

Forks