frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Ask HN: Our AWS account got compromised after their outage

297•kinj28•16h ago•67 comments

Ask HN: Are you / should we be preparing for "cyberattack"

4•lifeisstillgood•1h ago•2 comments

Did people in the 90s worry about the efficiency of the internet

9•burgiee•8h ago•8 comments

Ask HN: What are people doing to get off of VMware?

188•jwithington•2d ago•162 comments

Ask HN: How to stop an AWS bot sending 2B requests/month?

282•lgats•5d ago•181 comments

HTTP error codes illustrated with stills from Columbo

8•ColinWright•17h ago•5 comments

Walrus: A High Performance Storage Engine built from first principles

8•nubskr•20h ago•0 comments

Claude output matching copyrighted StackOverflow code

4•randsp•22h ago•4 comments

Ask HN: How does one build large front end apps without a framework like React?

106•thepianodan•4d ago•186 comments

Ask HN: Why is Bowker's monopoly on ISBNs in the USA legal?

17•blindprogrammer•1d ago•12 comments

Programming language agnosticism is the only way to move forward in life

29•amano-kenji•3d ago•20 comments

Ask HN: What are you working on? (October 2025)

346•david927•1w ago•1049 comments

Warning: Gmail client Show Original can omit lines of the original

18•chrisjj•2d ago•2 comments

Ask HN: Abandoned/dead projects you think died before their time and why?

362•ofalkaed•1w ago•890 comments

Ask HN: Best way to make a documentation website for an open-source project?

5•mudge•2d ago•5 comments

Ask HN: Why isn't Amazon.com impacted by AWS outages?

5•trevoragilbert•1d ago•11 comments

Ask HN: DOS Based "Multitaskers"

5•alexshendi•3d ago•2 comments

Ask HN: Web app freezes, but not when Chrome is recording. How to debug?

6•febed•5d ago•2 comments

Ask HN: SQL using relational theory books?

6•shivajikobardan•3d ago•3 comments

Ask HN: Testing AST or assembly output for a compiler

2•backslash_16•1d ago•2 comments

Ask HN: Those who applied to the OpenAI Grove program, did you ever hear back?

23•heywoods•2d ago•8 comments

Ask HN: What level of news do you need and not need?

10•bwb•1d ago•12 comments

Ask HN: Is there an open source HN?

10•shafkathullah•2d ago•9 comments

Ask HN: New YouTube player not working in Firefox

3•gethly•1d ago•11 comments

Ask HN: I have a CS degree but taught for 5 years– how can I get back into tech?

4•padzochambers•1d ago•17 comments

Ask HN: Estimation of copyright material used by LLM

5•megamix•3d ago•8 comments

You've reached the end!

Open in hackernews

Claude output matching copyrighted StackOverflow code

4•randsp•22h ago
I asked Claude to generate a C++ implementation of a base64 encoder, and the result was nearly identical to a version on StackOverflow. I guess that wouldn’t normally be an issue, except it turns out the StackOverflow example seems to be derived from copyrighted code.

Stackoverflow relevant comment: https://stackoverflow.com/questions/180947/base64-decode-snippet-in-c#comment137345692_13935718

Claude version:

std::string base64encode(const char* data, size_t length) { static const char* base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/";

  std::string result;
  result.reserve(((length + 2) / 3) * 4);

  size_t i = 0;
  unsigned char char_array_3[3];
  unsigned char char_array_4[4];

  while (length--)
  {
    char_array_3[i++] = *(data++);
    if (i == 3)
    {
      char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
      char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
      char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
      char_array_4[3] = char_array_3[2] & 0x3f;

      for (i = 0; i < 4; i++)
        result += base64_chars[char_array_4[i]];
      i = 0;
    }
  }

  if (i)
  {
    for (size_t j = i; j < 3; j++)
      char_array_3[j] = '\0';

    char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
    char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
    char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);

    for (size_t j = 0; j < i + 1; j++)
      result += base64_chars[char_array_4[j]];

    while (i++ < 3)
      result += '=';
  }

  return result;
}

Comments

falcor84•21h ago
Would you mind sharing the full conversation? I'm asking because there's not that much logic in this snippet, and I think that if your prompting was sufficiently specific, you could almost constrain it to give you something with this structure.
randsp•21h ago
I can’t share the full conversation, sorry. But I just took a function with the same purpose that used OpenSSL and asked Claude to rewrite it so it would work without relying on OpenSSL.
falcor84•16h ago
And how similar was this other function?
iExploder•2h ago
In 2025 IP and copyright don't play a role anymore ;)