Skip to content

Commit

Permalink
Official Tesla public key for smartcharge.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
fredli74 committed Jan 30, 2024
1 parent 7e57edc commit 22e8e7d
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzKRCd60+IUMk23i18iYZz0P88Xx7
b8hQ8Koye7Go6fa+QoizUwdMSguqATo5kgHQXZxFIrthnF1Lmzo1m9t/VQ==
-----END PUBLIC KEY-----
75 changes: 43 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,9 @@
},
"engines": {
"node": "12.7.x"
},
"volta": {
"node": "12.22.12",
"npm": "6.14.18"
}
}
Empty file added providers/tesla/README.md
Empty file.
7 changes: 5 additions & 2 deletions shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ export function secondsToString(
}

import md5 from "md5";
import { DateTime } from "luxon";
export function hashID(id: string, pepper: string): string {
return md5(`${pepper}+${id}`);
}
export function makePublicID(id: string, len?: number): string {
return md5("public+" + id).substr(0, len || 8);
return hashID(id, "public").substring(0, len || 8);
}

export type OpenDate = Date | null | number | string | undefined;
Expand Down Expand Up @@ -249,6 +251,7 @@ export async function asyncFilter<T>(
return array.filter((_v, index) => results[index]);
}

import { DateTime } from "luxon";
export function relativeTime(when: Date): { date: string; time: string } {
const nowLocal = DateTime.local();
const thenLocal = DateTime.fromJSDate(when).toLocal();
Expand Down

0 comments on commit 22e8e7d

Please sign in to comment.