Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(3)  |  Derive(0)  |  Import(3)
Encodes input using ASCII-Hex coding.

This is a verbose encoding used for binary data within
a PDF file.  One byte binary becomes two bytes of ASCII.
Helper function used by images.

        def _AsciiHexEncode(input):
    """Encodes input using ASCII-Hex coding.

    This is a verbose encoding used for binary data within
    a PDF file.  One byte binary becomes two bytes of ASCII.
    Helper function used by images."""
    if isUnicode(input):
        input = input.encode('utf-8')
    output = getBytesIO()
    output.write(binascii.b2a_hex(input))
    output.write(b'>')
    return output.getvalue()
        


src/m/w/mwlib.ext-0.13.2/upstream-src/tests/test_pdfbase_pdfutils.py   mwlib.ext(Download)
import os
import unittest
from reportlab.pdfbase.pdfutils import _AsciiHexEncode, _AsciiHexDecode
from reportlab.pdfbase.pdfutils import _AsciiBase85Encode, _AsciiBase85Decode
 
    def testAsciiHex(self):
        "Test if the obvious test for whether ASCII-Hex encoding works."
 
        plainText = 'What is the average velocity of a sparrow?'
        encoded = _AsciiHexEncode(plainText)

src/r/e/ReportLab-HEAD/tests/test_pdfbase_pdfutils.py   ReportLab(Download)
import os
import unittest
from reportlab.pdfbase.pdfutils import _AsciiHexEncode, _AsciiHexDecode
from reportlab.pdfbase.pdfutils import _AsciiBase85Encode, _AsciiBase85Decode
 
    def testAsciiHex(self):
        "Test if the obvious test for whether ASCII-Hex encoding works."
 
        plainText = 'What is the average velocity of a sparrow?'
        encoded = _AsciiHexEncode(plainText)

src/r/e/reportlab-3.1.8/tests/test_pdfbase_pdfutils.py   reportlab(Download)
import os
import unittest
from reportlab.pdfbase.pdfutils import _AsciiHexEncode, _AsciiHexDecode
from reportlab.pdfbase.pdfutils import asciiBase85Encode, asciiBase85Decode
from reportlab.lib.utils import asBytes
    def testAsciiHex(self):
        "Test if the obvious test for whether ASCII-Hex encoding works."
 
        plainText = 'What is the average velocity of a sparrow?'
        encoded = _AsciiHexEncode(plainText)