Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    There si a mistake in Base64 --> Uint8Array. c.charCodeAt(0) should be instead c.charCodeAt(c). Commented Feb 28, 2023 at 15:24
  • Does not work for input [190, 160, 173, 152, 53, 234] Commented Mar 11, 2023 at 11:34
  • @Marv-CZ I apologise. You are correct! I have updated the code. Commented Mar 13, 2023 at 12:14
  • @WolfgangKuehn The code has been updated. It works fine now with your input data set. Commented Mar 13, 2023 at 12:14
  • 2
    @Marv-CZ no, c.charCodeAt(0) is correct. You get a single character, say, "6", and get the charcode of its zeroth character, again 6, which gives 0x36. If you use c.charCodeAt(c), it will seem to work because "a".charCodeAt("a") is "a".charCodeAt(0), as "a" is not a number. But with 53 - that is, "5" - as Wolfgang Kuehn noticed, you will get "5".charCodeAt("5"), which is the fifth character of "5", which does not exist, and you will get NaN and break the code. charCodeAt() works because the missing argument is considered 0, but is still not correct. Commented Apr 8, 2024 at 16:03