update instancejson more

MY HEAD HURTS NOW ;(

.

.

more work

Finish rewrite

all finished
This commit is contained in:
MathMan05
2024-09-16 19:11:05 -05:00
committed by Scott Gould
parent 3a61417de2
commit 758bd7cc7a
113 changed files with 12520 additions and 20427 deletions

20
src/webpage/snowflake.ts Normal file
View File

@@ -0,0 +1,20 @@
abstract class SnowFlake {
public readonly id: string;
constructor(id: string) {
this.id = id;
}
getUnixTime(): number {
return SnowFlake.stringToUnixTime(this.id);
}
static stringToUnixTime(str: string) {
try {
return Number((BigInt(str) >> 22n) + 1420070400000n);
} catch {
console.error(
`The ID is corrupted, it's ${str} when it should be some number.`
);
return 0;
}
}
}
export { SnowFlake };