KeyHelpers

Namespace: Babel.Licensing Assembly: Babel.Licensing.dll

String license helpers.

public static class KeyHelpers

Inheritance

objectKeyHelpers

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Methods

ToReadableKey(string, int)

Split the license key in tokens separated by a '-' character to provide a more convenient and human readable license string.

public static string ToReadableKey(string key, int tokenSize)

Parameters

NameDescription

key string

The license key.

tokenSize int

The length of each readable key token.

Returns

NameDescription

The given key converted to human readable string.

Examples

// Returns XYZW5-RTJ3W-DA13M-8RCGY-OMX7Z
string readableKey = KeyHelpers.ToReadableKey("XYZW5RTJ3WDA13M8RCGYOMX7Z", 5);

Exceptions

NameDescription

Thrown when the key argument is null.

Thrown when the tokenSize argument is a negative integer.

Last updated