Data URL

From PenguinMod Wiki
Jump to navigation Jump to search

Data URL's are strings that can contain the data of practically any file in it. As opposed to regular URL's, Data URL's do not fetch the internet, and run locally. Data URL's contain the binary or text data of their file, which is usually encoded into base64. Many blocks on PenguinMod can read or output base64. A notable example is the Files Extension, which allows users to not only import and export files from text, but from data URL and Array Buffer.

Syntax

Usually, a data URL starts with this:

data:content/type;base64,

Everything after this would be the file encoded into Base64. Opposed to this, data URL's can also contain text.

data:text/plain;charset=UTF-8;page=21,penguinmod%20is%20cool

Outputs "penguinmod is cool".

See Also

Data URL Scheme on Wikipedia