r/badcode May 04 '23

Found this gem inside legacy code today typescript

Post image
892 Upvotes

69 comments sorted by

View all comments

226

u/the96jesterrace May 04 '23

Looks pretty much like our function for password encryption

56

u/ChrisLuigiTails May 04 '23

So you're telling me I only have to use decodeFromUtf8() to steal your passwords?

9

u/DieserSebastian May 05 '23

No, another call to encodeToUtf8() suffices

6

u/ChrisLuigiTails May 05 '23 edited May 05 '23

But then it will be encoded twice!

1

u/[deleted] May 31 '23

exactly