this post was submitted on 28 Apr 2025
156 points (100.0% liked)

Technology

69545 readers
3506 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 9 points 3 days ago (3 children)

That base64 is so long, and doesn't need to be. An IP address is 4 bytes so it could be represented as simply 8 hex digits (base64 also expands to 8 due to padding).

[–] [email protected] 3 points 3 days ago (1 children)

An IP address is 4 bytes

IPv6 exists you know?

[–] [email protected] 1 points 3 days ago (1 children)

Yes but OP took the string representation of the IPv4 and base64'd it, I was addressing that part specifically.

[–] [email protected] 1 points 3 days ago* (last edited 3 days ago)

And I'm addressing your statement that "an IP address is 4 bytes" in specific. I understand their example is IPv4, but you just blatantly said that "An IP address is 4 bytes" when that's not the case for IPv6 which a good chunk of the world is using now (still not a majority though...).

His code takes the base64 of anything that's returned in both (together) ip and timestamp. So the long string is both values concat'd then encoded. Most of that string is going to be the timestamp...

Specifically MTEuMjIuMzMuNDQ is 11.22.33.44
Where ---KIApTdW5kYXksIDI3LUFwci0yMDI1IDE1OjA0OjM5IENFU1QK is the date string Sunday, 27-Apr-2025 15:04:39 CEST.

While it's still a "bigger" value than it needs to be, it's not like it's the end of the world for an email address. I mean, if we really want to get "fancy" most people don't know that you can just go to an IP address in it's decimal form...

1.1.1.1 -> 16843009 (http://16843009) No need to encode anything special at all in that case. But that's neither here nor there... Can always make your own with blackjack and hookers of course.

load more comments (1 replies)