Code Monkey home page Code Monkey logo

Comments (3)

dkrutsko avatar dkrutsko commented on June 11, 2024 1

Yeah, I thought about escape characters, such as \a for 0 and \b for 1, however then you are using double the number of characters to represent a single character, which will bloat the size a bit. Though one thing that came to my mind is what if the final output was not stored as text, but instead was stored as binary data. Similar to how MessagePack does it. And if you ever wanted to convert it back to text, you could just encode it using Base64. Regardless, I implemented my own version of the unpack function in TypeScript to suit my purpose, it returns a Set. Perhaps someone will find it useful. I also modified the packer to drop the true¦ portion from the beginning.

from efrt.

spencermountain avatar spencermountain commented on June 11, 2024

oh hey cool - sounds like a neat project.
Yeah, I agree. The way it quietly fails on some characters right now is bad. Is it possible to have a pipe character or a semicolon in a domain? I didn't think through this enough, when making this. Be careful with your example that you are not converting any intended ) characters to 0s, etc

I also agree the array output thing is awkward.

hmm. Sounds like we're making an API change. I agree it's due.
if you have any ideas how this could look, i'm open to them. Otherwise I'll have to noodle on this a bit
cheers

from efrt.

spencermountain avatar spencermountain commented on June 11, 2024

yeah, your encoding example can work because your input can be checked ahead of time. It's a fine solution, as long as you're careful about not also using these additional encoding characters as inputs.

prepending backslashes like '\5' in the compressed text is be a better solution, but will require a fair amount of complexity within the library. it may throw-off the indexes and stuff. Then it's how do you encode a backslash, etc. - could be a real doozie

from efrt.

Related Issues (5)

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.