https://github.com/clonkk/bytesequtils
Some utility function to manipulate buffers as string or seq[byte]
https://github.com/clonkk/bytesequtils
bytesequtils nim seq string
Last synced: about 1 year ago
JSON representation
Some utility function to manipulate buffers as string or seq[byte]
- Host: GitHub
- URL: https://github.com/clonkk/bytesequtils
- Owner: Clonkk
- License: mit
- Created: 2020-11-12T11:47:12.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-25T09:39:33.000Z (over 4 years ago)
- Last Synced: 2025-04-01T16:58:32.248Z (about 1 year ago)
- Topics: bytesequtils, nim, seq, string
- Language: Nim
- Homepage: https://clonkk.github.io/bytesequtils/
- Size: 126 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bytesequtils
A collections of ``template`` and ``proc`` to make it easier to work with buffer storing data in either ``string`` or ``seq[byte]``
Note that it **doesn't** support ``openArray[byte]``. Conversion to ``string`` do not append `'\0'` therefore using it for as ``cstring`` or with C-API is **unsafe**.
## Installation
``nimble install bytesequtils``
To generate the documentation locally use ``nimble doc --project src/bytesequtils.nim --out:docs/`` or ``nimble gendoc``
## Conversion by moving memory
The goal is to obtains a ``string``representation of ``seq[byte]`` without copy.
To accomplish that, it is necessary to ``move`` memory.
Since ``move``operation can only be done on mutable memory, immutable data will be copied and thus, will be much slower.
## Detailed documentaton
Read the documentation at https://clonkk.github.io/bytesequtils/.