Notice: You have been identified as a bot, so no internal UID will be assigned to you. If you are a real person messing with your useragent, you should change it back to something normal.

Minichan

Topic: I recently found out JavaScript has a .toHex() function

Handsome Squidward started this discussion 3 hours ago #135,762

I’m sorry, I know you all don’t care.

new TextEncoder().encode(str).toHex()

YOU’RE TELLING ME CONVERTING UNICODE INTO A BASE 16 ENCODED HEX STRING IS A ONE LINER AND DON’T HAVE TO WRITE SOME Array.from() bs to convert the Uint8Array into an array so I can use .map and return a string type instead of a uint8 from the callback function and then do some bs with .padStart() I forget which argument is the number and which is the string.

It’s so beautiful 🥹

Handsome Squidward (OP) double-posted this 3 hours ago, 5 minutes later[^] [v] #1,442,297

🙏

https://tc39.es/ecma262/multipage/indexed-collections.html#sec-uint8array.prototype.tohex

Handsome Squidward (OP) triple-posted this 2 hours ago, 34 minutes later, 39 minutes after the original post[^] [v] #1,442,301

You’ve gotta love JavaScript. One of the world’s most popular languages still missing basic features in 2026. For example, it used to be for years it didn’t have a module import system. They added one. Nice. How do you package it?

You need 3rd party tools. 🥳

Node JS doesn’t count. I mean, the language itself. It has no system for packaging modules. This is one of the most popular languages in the world. It has no built in system for packaging modules into a single file.
:

Please familiarise yourself with the rules and markup syntax before posting.