Comments (12)
Sorry, but transforming one dictionary to another is out of scope of this project.
from asn1tools.
So for encoding or decoding we have to pass some integer or string value to dictionaries which we create right,how it is done
from asn1tools.
You have to be more specific. It's impossible to understand what you want to achieve.
from asn1tools.
Parse_files function will create a dictionary which will have members ,and type of members may be string or integer etc ,Now with respect to my understanding for encoding or decoding to happen we give the members with value such as 1,2 etc which is integer datatype,So my question was that is there way to give values to the members
from asn1tools.
See https://github.com/eerimoq/asn1tools#scripting
from asn1tools.
I still don't understand what you want to achieve, sorry.
from asn1tools.
How can we assign values to the members of the dictionary which your module is creating.
from asn1tools.
Can the value for the members be assigned through the program itself.
from asn1tools.
import asn1tools
foo = asn1tools.compile_files('tests/files/foo.asn')
encoded = foo.encode('Question', {'id': 1, 'question': 'Is 1+1=3?'})
encoded
bytearray(b'0\x0e\x02\x01\x01\x16\x09Is 1+1=3?')
foo.decode('Question', encoded)
{'id': 1, 'question': 'Is 1+1=3?'}
Now it looks OK since there are only two members inside Question schema but consider a scenario where i need to assign value for member3 with value 4 which is under schema of schema of schema.Then to encode you need to do something like this
encoded = foo.encode('Random', {'member1': {member2:{member3:4}}})
Is there a way where you give value for member3=4 and it itself creates the dictionary of dictionaries format for encoding based on hierarchy got from asn1tools.parse_files('tests/files/foo.asn')
from asn1tools.
No, there is no support in asn1tools for using the dictionary created by parse_files()
to generate dictionaries with data to encode with foo.encode()
. Why do you need that?
from asn1tools.
Ok currently I have to handle schema whose members may be again schemas which might extrend upto n levels,Now my task is to create a dictionary of dictionaries for any schema,and value for its members i will fill through an excel sheet, and then later use that dictionary for encoding .I was confused whether I can utilize your asn1tools.parse_files('tests/files/foo.asn') which is returning a dictionary showing the hierarchy of parent dictionary and its child members, and then utilize that hierarchy to fill the values to create the dictionary needed for encoding.
from asn1tools.
Ok, as that functionality is not supported I suggest closing this issue.
from asn1tools.
Related Issues (20)
- Missing support for BCDString in BER HOT 1
- asn1tools.codecs.ber.DecodeTagError: HOT 2
- GSER decoding is not implemented
- Support for CLASS HOT 1
- Generate C source: Unsupported type 'BIT STRING' HOT 3
- Unsupported type 'BIT STRING' error in generate C source uper HOT 3
- python asn1tools BitString uper encoded wrong value HOT 1
- Objects set members are not parsed at all HOT 2
- ASN1Tools Fails to Compile 3GPP Release 16 ASN.1 HOT 3
- Expected enumeration index 0, 1 or 2, but got 3
- Generated C OER decoder fails to decode fixed-length sequences with lengths of more than 255
- Decode successfully ignores extra bytes HOT 2
- encode_message() fails to validate ASN.1 BIT STRING SIZE constraints
- how to parse the "CONTAING SEQUENCE" msg immediately HOT 1
- Compile nrppa using PER fail
- How to view encoded values
- Test failures with pyparsing 3.1.1 HOT 4
- oer c code generation fails when addition contains a sequence with enums (type error) HOT 2
- decoding erros HOT 9
- SEQUENCE OF has no maximum length HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asn1tools.