mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-10-07 06:08:00 +03:00
amnet-native initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
export interface AMServerInfoResponse {
|
||||
server_name: string;
|
||||
api_version: number;
|
||||
}
|
||||
|
||||
export interface AMCardInRequest {
|
||||
card_id: 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;
|
||||
}
|
||||
Reference in New Issue
Block a user