Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fiorix/pyascii85
Ascii85 encoder and decoder for python
https://github.com/fiorix/pyascii85
Last synced: 18 days ago
JSON representation
Ascii85 encoder and decoder for python
- Host: GitHub
- URL: https://github.com/fiorix/pyascii85
- Owner: fiorix
- License: gpl-2.0
- Created: 2013-07-31T13:06:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-07-31T13:06:40.000Z (over 11 years ago)
- Last Synced: 2024-10-15T11:21:40.305Z (2 months ago)
- Language: C
- Homepage:
- Size: 113 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
Awesome Lists containing this project
README
This Python extension provides Ascii85 Data Encodings.
For more information check wikipedia's Ascii85:
http://en.wikipedia.org/wiki/Ascii85BUILDING
To build the extension do the following:
$ python setup.py build_ext -iUSAGE
encoding:
encode(input, output, begin_tag=True, end_tag=True)
b85encode(buffer, begin_tag=True, end_tag=True)
decoding:
decode(input, output)
b85decode(buffer)TAGS
Ascii85 begin and end tags are <~ and ~>, respectively. Why they're optional while encoding?
For instance, when embedding RGB images into PostScript as Ascii85, the initial tag <~ isn't necessary.However, the decoder require such tags.
EXAMPLES
(from buffer)
>>> import ascii85
>>> v = ascii85.b85encode('sample test')
>>> ascii85.b85decode(v)
'sample test'
>>> v
'<~F(&p)Ch4`2ATMq~>\n'
(from file)
>>> ascii85.encode(file('/etc/motd'), sys.stdout)
<~9PJBeGT^d?DJ((I/iG=;0J,";/SAX4ATDKp+9DBO%4Ec#k?AoD]4ART(^+E
2@>B6%Et+CT;%+Co&)@rc9mARlotDBO%7AI<-hA8-4$A9D(ATJu.DBLTTF)ipTBOPpm
04]!20.JVbDfBuBBkM+$/[email protected]/4+@/=m:J=bf78-i,:/
2008-01-03 Alexandre Fiori