merge: upstream performance changes & instance silencing
This commit is contained in:
commit
68886b9ab5
209 changed files with 1064 additions and 1019 deletions
|
|
@ -24,8 +24,7 @@ function getNoise(): string {
|
|||
return counter.toString(36).padStart(2, '0').slice(-2);
|
||||
}
|
||||
|
||||
export function genAid(date: Date): string {
|
||||
const t = date.getTime();
|
||||
export function genAid(t: number): string {
|
||||
if (isNaN(t)) throw new Error('Failed to create AID: Invalid Date');
|
||||
counter++;
|
||||
return getTime(t) + getNoise();
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ function getNoise(): string {
|
|||
return counter.toString(36).padStart(NOISE_LENGTH, '0').slice(-NOISE_LENGTH);
|
||||
}
|
||||
|
||||
export function genAidx(date: Date): string {
|
||||
const t = date.getTime();
|
||||
export function genAidx(t: number): string {
|
||||
if (isNaN(t)) throw new Error('Failed to create AIDX: Invalid Date');
|
||||
counter++;
|
||||
return getTime(t) + nodeId + getNoise();
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ function getRandom() {
|
|||
return str;
|
||||
}
|
||||
|
||||
export function genMeid(date: Date): string {
|
||||
return getTime(date.getTime()) + getRandom();
|
||||
export function genMeid(t: number): string {
|
||||
return getTime(t) + getRandom();
|
||||
}
|
||||
|
||||
export function parseMeid(id: string): { date: Date; } {
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ function getRandom() {
|
|||
return str;
|
||||
}
|
||||
|
||||
export function genMeidg(date: Date): string {
|
||||
return 'g' + getTime(date.getTime()) + getRandom();
|
||||
export function genMeidg(t: number): string {
|
||||
return 'g' + getTime(t) + getRandom();
|
||||
}
|
||||
|
||||
export function parseMeidg(id: string): { date: Date; } {
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ function getRandom() {
|
|||
return str;
|
||||
}
|
||||
|
||||
export function genObjectId(date: Date): string {
|
||||
return getTime(date.getTime()) + getRandom();
|
||||
export function genObjectId(t: number): string {
|
||||
return getTime(t) + getRandom();
|
||||
}
|
||||
|
||||
export function parseObjectId(id: string): { date: Date; } {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue