Skip to content

Commit

Permalink
added comment with source of encodeBase64
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Lively authored Aug 5, 2022
1 parent 5f0c10c commit 4f517ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extensions/ipynb/src/notebookImagePaste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export function imagePasteSetup() {
});
}

/**
* Taken from https://github.com/microsoft/vscode/blob/743b016722db90df977feecde0a4b3b4f58c2a4c/src/vs/base/common/buffer.ts#L350-L387
*/
function encodeBase64(buffer: Uint8Array, padded = true, urlSafe = false) {
const base64Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const base64UrlSafeAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
Expand Down

0 comments on commit 4f517ba

Please sign in to comment.