mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
22 lines
573 B
TypeScript
22 lines
573 B
TypeScript
export const licenseSuccess = {
|
|
success: true,
|
|
uses: 4,
|
|
purchase: {}
|
|
};
|
|
|
|
export const licenseFail = {
|
|
success: false,
|
|
message: "That license does not exist for the provided product."
|
|
};
|
|
|
|
|
|
const subCode = (length = 8) => {
|
|
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
let result = "";
|
|
for (let i = 0; i < length; i++) {
|
|
result += characters[(Math.floor(Math.random() * characters.length))];
|
|
}
|
|
return result;
|
|
};
|
|
|
|
export const generateLicense = (): string => `${subCode()}-${subCode()}-${subCode()}-${subCode()}`;
|