diff options
author | Ilya Etingof <etingof@gmail.com> | 2016-04-17 20:40:37 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2016-04-17 20:40:37 +0200 |
commit | 8fd98139e8f568f239a6e3d0d2532c7cdefb0bd7 (patch) | |
tree | 75fc6af89db98ae5832c0a91d1f9fb3a2ecaddc1 /README.md | |
parent | fa78f1b0b3cd8c9628f8862ce1c19b7597a08be6 (diff) | |
download | pyasn1-git-8fd98139e8f568f239a6e3d0d2532c7cdefb0bd7.tar.gz |
example improved
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -92,8 +92,21 @@ turn serialized ASN.1 content, as received from network or read from a file, into a fully-fledged, initialized data structure. ```python ->>> encode(record) +>>> substrate = encode(record) +>>> substrate b'0\x07\x02\x01{\x80\x02\x01A' +>>> +>>> decoded_record, substrate = decode(substrate, asn1Spec=Record()) +>>> +>>> print(decoded_record.prettyPrint()) +Record: + id=123 + room=321 + house=0 +>>> +>>> record == decoded_record +True +>>> ``` Many high-profile Internet protocols and file formats utilize ASN.1 serialization. |