Comments (2)
There's nothing built into pyffx that would help, but there's probably a way to implement this restriction on top of it.
If you don't need to preserve the length of the output you could try to escape the sequences you don't want (e.g. replace "\n" -> "\n0" and "0" -> "00").
Alternatively, you could also try to come up with a scheme that uses a bigger alphabet, e.g.
safe_chars = set(string.printable)
alphabet = (chars - {'\n'}) | {f'\n{c}' for c in chars - {'\r'}}
If the length of the string is odd you need to treat the last char specially or pad the string.
from pyffx.
I'm closing this issue for now. Feel free to to open a PR if there's something unversally useful you'd like to add to pyffx. Regarding your actual problem, stackoverflow might be a better place to ask for an encoding scheme.
from pyffx.
Related Issues (10)
- Something wrong with pyffx.Integer HOT 3
- Apparent issues with cipher quality HOT 1
- counter i is reset to 0 for each round HOT 2
- Integer codec does not preserve length HOT 1
- pycrypto dependency should be updated to pycryptodome HOT 1
- Installation Error on Centos 7(Python 3.6)
- pip install encoding issue in setup.py on Windows HOT 5
- ValueError for capital letters and special characters HOT 1
- Are there guaranteed to be no collisions when using hashlib.sha1? HOT 2
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 pyffx.