MCPcopy
hub / github.com/gchq/CyberChef / present

Method present

src/core/operations/CoverImage.mjs:139–149  ·  view source on GitHub ↗

* Displays the covered image using HTML for web apps * @param {ArrayBuffer} data * @returns {html}

(data)

Source from the content-addressed store, hash-verified

137 * @returns {html}
138 */
139 present(data) {
140 if (!data.byteLength) return "";
141 const dataArray = new Uint8Array(data);
142
143 const type = isImage(dataArray);
144 if (!type) {
145 throw new OperationError("Invalid file type.");
146 }
147
148 return `<img src="data:${type};base64,${toBase64(dataArray)}">`;
149 }
150}
151
152export default CoverImage;

Callers

nothing calls this directly

Calls 2

isImageFunction · 0.90
toBase64Function · 0.90

Tested by

no test coverage detected