mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-25 15:47:59 +03:00
28 lines
564 B
TypeScript
28 lines
564 B
TypeScript
export interface AMServerInfoResponse {
|
|
serverName: string;
|
|
apiVersion: number;
|
|
}
|
|
|
|
export interface AMCardInRequest {
|
|
cardId: string;
|
|
}
|
|
|
|
export function generateCardNumber(): string {
|
|
let cardId = '';
|
|
|
|
while (true) {
|
|
// don't start with a 3
|
|
const firstDigit = Math.floor(Math.random() * 10);
|
|
|
|
if (firstDigit !== 3) {
|
|
cardId = firstDigit.toString();
|
|
break;
|
|
}
|
|
}
|
|
|
|
for (let i = 0; i < 19; i++) {
|
|
cardId += Math.floor(Math.random() * 10).toString();
|
|
}
|
|
|
|
return cardId;
|
|
} |