-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support the dataBinary action in the openedFile event
- Loading branch information
1 parent
5791908
commit 6d76072
Showing
3 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export function base64ToBytesArray(data: string): ArrayBuffer { | ||
let binaryData: string = window.atob(data); | ||
let len: number = binaryData.length; | ||
let bytes: Uint8Array = new Uint8Array(len); | ||
|
||
for (let i = 0; i < len; i++) { | ||
bytes[i] = binaryData.charCodeAt(i); | ||
} | ||
|
||
return bytes.buffer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters