Giter Site home page Giter Site logo

ber-tlv's Introduction

ber-tlv's People

Contributors

dependabot[bot] avatar philipschoemig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ber-tlv's Issues

Whitespace is removed from XML element text with type ASCII

When parsing a TLV tree from XML all whitespace is removed from the XML element text for a primitive tag. However, if the "Type" attribute is "ASCII" the whitespace must be included.

Example:
<Primitive Tag="0x5F20" Type="ASCII">123 Go!</Primitive>

This will currently produce the following TLV tree:

root
└── 5f20: 313233476f21

But it should be:

root
└── 5f20: 31323320476f21

Use poetry version command to bump package version

Instead of using an external tool like bump2version the poetry command version could be used to increase the package version. For this to work the duplicate version information in src/bertlv/init.py and docs/conf.py must be removed.

init.py

The version variable could be assigned to the package version retrieved from importlib.metadata.version() as suggested in poetry issue #144. Example code:

try:
    import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
    import importlib_metadata

__version__ = importlib_metadata.version(__name__)

See the complete solution in this comment: python-poetry/poetry#2366 (comment)

However, for python version <3.8 this would introduce a dependency to importlib_metadata.

conf.py

The version should be retrieved by accessing the __version__ variable from the bertlv module. Example code:

import bertlv
version = bertlv.__version__

to use it as decoder

Could you please guide me or provide any documentation to use this to decode BER TLV file.
The file is in binary format. When read as binary file, the sample output for the binary data file is as follow:
b'0\x82*\xd1\xa0\x10\x80\t\x18\x11 \x1807+\x05\x00\x81\x01\x00\xa2\x00\xa1\x82*\x8e\xa0\x82\x01\x8e\x80\x01\

Thanks for support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.