CoCalc Public Filestmp / 2015-01-06-215530.sagewsOpen in with one click!
Authors: Harald Schilly, ℏal Snyder, William A. Stein
!ls -lh *.pdf
-rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 1004K Dec 12 18:36 2014-10-03-170445.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 50K Oct 27 23:26 2014-10-27-142257.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 41K Oct 28 03:19 2014-10-27-201733.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 32K Nov 2 19:16 2014-11-02-111607.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 21K Nov 4 01:34 2014-11-02-115521.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 39K Nov 3 13:51 2014-11-03-054947.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 456K Nov 3 21:02 2014-11-03-063757.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 37K Nov 13 23:48 2014-11-13-154611.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 28K Nov 25 22:45 2014-11-25-143958.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 118K Dec 4 19:59 2014-12-04-111538.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 126K Dec 7 01:30 A & B.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 71K Dec 22 06:54 a.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 161K Oct 28 14:54 latexexample.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 36K Nov 3 13:58 number #1.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 28K Oct 27 21:23 other.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 229K Oct 26 23:09 Sender.pdf -rw-rw---- 1 4a5f054258734eeda85ca18c706e8bcd 4a5f054258734eeda85ca18c706e8bcd 268K Nov 8 17:55 Test_graphics.pdf
a = open('2014-10-03-170445.pdf').read()
len(a)
1027314
import base64 b = base64.b64encode(a)
len(b)
1369752
1.*len(b)/len(a)
1.33333333333333
%timeit base64.b64decode(b) == a
125 loops, best of 3: 6.53 ms per loop
base64.b64decode(b) == a
True
import json
s = json.dumps(b)
len(s)
1369754
%timeit s = json.dumps(b)
125 loops, best of 3: 1.93 ms per loop
json.dumps("foo bar")
'"foo bar"'
base64.b64decode('OGYxNTFjM2UtZThmMy00MjFhLTlkY2EtM2JmMWUyNjMwZDQ5')
'8f151c3e-e8f3-421a-9dca-3bf1e2630d49'