mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
35237a5835
Summary: Adds a new Support Grist page (accessible only in grist-core), containing options to opt in to telemetry and sponsor Grist Labs on GitHub. A nudge is also shown in the doc menu, which can be collapsed or permanently dismissed. Test Plan: Browser and server tests. Reviewers: paulfitz, dsagal Reviewed By: paulfitz Subscribers: jarek, dsagal Differential Revision: https://phab.getgrist.com/D3926
13 lines
471 B
TypeScript
13 lines
471 B
TypeScript
import {createHash} from 'crypto';
|
|
|
|
/**
|
|
* Returns a hash of `id` prefixed with the first 4 characters of `id`. The first 4
|
|
* characters are included to assist with troubleshooting.
|
|
*
|
|
* Useful for situations where potentially sensitive identifiers are logged, such as
|
|
* doc ids of docs that have public link sharing enabled.
|
|
*/
|
|
export function hashId(id: string): string {
|
|
return `${id.slice(0, 4)}:${createHash('sha256').update(id.slice(4)).digest('base64')}`;
|
|
}
|