mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
make generateId public
This commit is contained in:
@@ -13,7 +13,7 @@ export class ChapmanTimedApiBasedParkingRepositoryLoader implements ParkingRepos
|
||||
// TODO
|
||||
}
|
||||
|
||||
private normalizeAddress(address: string): string {
|
||||
private static normalizeAddress(address: string): string {
|
||||
return address
|
||||
.toLowerCase()
|
||||
.split(/\s+/)
|
||||
@@ -21,12 +21,12 @@ export class ChapmanTimedApiBasedParkingRepositoryLoader implements ParkingRepos
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
private generateId(address: string): string {
|
||||
public static generateId(address: string): string {
|
||||
const normalized = this.normalizeAddress(address);
|
||||
const hash = createHash('sha256')
|
||||
.update(normalized)
|
||||
.digest('hex');
|
||||
|
||||
return hash.substring(0, 12);
|
||||
return hash.substring(0, 32);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user