mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: deduplicate encryption helpers (#4146)
This commit is contained in:
parent
f59e608f18
commit
6143d5195a
9 changed files with 84 additions and 148 deletions
|
@ -449,3 +449,9 @@ export const preventUnload = (event: BeforeUnloadEvent) => {
|
|||
// NOTE: modern browsers no longer allow showing a custom message here
|
||||
event.returnValue = "";
|
||||
};
|
||||
|
||||
export const bytesToHexString = (bytes: Uint8Array) => {
|
||||
return Array.from(bytes)
|
||||
.map((byte) => `0${byte.toString(16)}`.slice(-2))
|
||||
.join("");
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue