1

I have a static HTML site, which cannot load any other resources, because it is supposed to work offline as well. The JavaScript code, which is embedded in <script> tags, needs to load (and store) a lot of binary data.

Storing the data as an array of numbers is inefficient, a binary-to-text encoding scheme seems to be required. Which one has the highest compression ratio and can still be read and contained within the <script>-tags?

Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345
2080
  • 1,223
  • 1
  • 14
  • 37

1 Answers1

0

If your page can load .js then probably it also can load any other files, however if you really want to store data in js then use base64 encoding (here "comparison" with base128)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345