Claude Output Matching Copyrighted Stackoverflow Code
Key topics
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;
}The author asks Claude to generate a C++ base64 encoder and finds the output nearly identical to a StackOverflow version derived from copyrighted code, raising concerns about AI-generated code and copyright infringement.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
23m
Peak period
2
0-2h
Avg / period
1.3
Key moments
- 01Story posted
Oct 21, 2025 at 6:37 AM EDT
3 months ago
Step 01 - 02First comment
Oct 21, 2025 at 7:00 AM EDT
23m after posting
Step 02 - 03Peak activity
2 comments in 0-2h
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 22, 2025 at 2:30 AM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.