Code Monkey home page Code Monkey logo

Comments (11)

halvardssm avatar halvardssm commented on June 8, 2024 2

Thanks for the feedback! I added it here to a new project https://github.com/halvardssm/deno_stdext 💪🏻 (JSR link)

from deno_std.

halvardssm avatar halvardssm commented on June 8, 2024 1

Not really, that function only encodes to hex, it does not create a format for debugging as above.

from deno_std.

iuioiua avatar iuioiua commented on June 8, 2024

Like encodeHex()?

from deno_std.

kt3k avatar kt3k commented on June 8, 2024

Keep using 3rd party libraries

Which 3rd party libs do you use now?

from deno_std.

halvardssm avatar halvardssm commented on June 8, 2024

None at the moment. I didn't find one I wanted to use since I wanted to keep 3rd party deps to a minimum, so I just created my own.

Here are some that I considered:

from deno_std.

kt3k avatar kt3k commented on June 8, 2024

Maybe let's start with a minimal set of options.

00000000 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 |0123456789ABCDEF|

I think the use of vertical bar can be confusing. How about following the output format of hexy?

function hexdump(buffer: ArrayBufferView): string

Probably we should also support ArrayBuffer input? Some of Web APIs (such as Web Crypto API) return ArrayBuffer instead of ArrayBufferView

from deno_std.

halvardssm avatar halvardssm commented on June 8, 2024

I chose the vertical bars since they align with the output from the hexdump command, and honestly I like it more than the hexy format.

➜  dev echo "Hello World" > hdfile
➜  dev hexdump -C hdfile          
00000000  48 65 6c 6c 6f 20 57 6f  72 6c 64 0a              |Hello World.|

Good idea, lets support both. Any other interface we should also support?

from deno_std.

halvardssm avatar halvardssm commented on June 8, 2024

Can I create a PR, or is there still room for discussion regarding the function?

from deno_std.

iuioiua avatar iuioiua commented on June 8, 2024

It seems unlikely that the average JavaScript developer would ever need this. I'm not for having this in the Standard Library, but I think it'd be a great fit for a third-party module.

from deno_std.

kt3k avatar kt3k commented on June 8, 2024

Golang has Dump in encoding/hex which does almost the same thing. https://pkg.go.dev/encoding/hex#Dump

from deno_std.

iuioiua avatar iuioiua commented on June 8, 2024

We discussed this internally and thought such an API would be best in a third-party module rather than the Standard Library. Either way, thank you for the suggestion, @halvardssm! Let us know if you end up publishing 🙂

from deno_std.

Related Issues (20)

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.