Comments (6)
Not that I can think of, but was some time I used bincopy so I might have forgotten. If you have time you could submit a PR with the change and I can have a closer look (and maybe you encounter some problem).
from bincopy.
Feel free to make it public on Segment as well.
from bincopy.
Good suggestion (probably). Part of version 18.0.0.
from bincopy.
In case this breaks peoples code, I could add aliases like _Segments = Segments
. I think I'll do that actually.
from bincopy.
Great! Here's another, related suggestion: Segment.chunks
should yield smaller Segment
s instead of Chunks
.
My use case is that I need to split a Segment
into chunks for writing to a target device. Then I need to split those chunks into smaller chunks in order to calculate a checksum of the larger chunk. But Chunk
doesn't have a .chunks
method, so that doesn't work :(
Instead, I created a new Segment
and chunked that:
Segment(chunk.address, chunk.address + len(chunk.data), chunk.data, 1).chunks()
But is there any reason chunks
can't just yield Segments
to begin with?
from bincopy.
Segment._word_size_bytes
should have a public getter. It is useful to be able to get chunks of a certain number of bytes, for example when calculating a checksum. Since .chunks
wants the size and alignment in words, it is necessary to know the word size to get a certain number of bytes per chunk. The Segment
knows it internally, but it's only public on the BinFile
, which may not be available in a subroutine.
from bincopy.
Related Issues (20)
- BinFile maximum_address is actually pointing 1 byte "further"? HOT 2
- Enhancement don't parse no vailed lines of the end HOT 4
- module entry point is broken HOT 4
- save the object bincopy.BinFile HOT 1
- Invalid ELF file parsing HOT 4
- Extract data by address in S19 HOT 3
- fill empty space HOT 1
- Incorrect error check condition? HOT 3
- Enhancement: support full Verilog hex format HOT 2
- as_binary() raises a MemoryError HOT 5
- Change behaviour of `as_binary` when data is not present? HOT 2
- Invalid section from ELF file HOT 18
- 17.14.3: Missing some test files in sdist tarball HOT 4
- Do we have function like change s19 content? HOT 4
- Chunk.__len__ should return length of data HOT 1
- Feature request: Support Microchip HEX format HOT 3
- First chunk is misaligned if segment has non-aligned start address HOT 2
- Problem with loading ELF file produced by CodeWarrior toolchain HOT 1
- convert S19 to S19 file (add empty space and create new S19 file)
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 bincopy.