frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Claude output matching copyrighted StackOverflow code

4•randsp•2h 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•2h 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•2h 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.

Show HN: Apicat – A Lightweight Offline Postman Alternative

https://apicat.com
1•abacussh•33s ago•0 comments

Limits on Stochastic Length Fluctuations from Table-Top Interferometers

https://link.aps.org/doi/10.1103/61j9-cjkk
1•PaulHoule•1m ago•0 comments

Don't use AI to tell you how to vote in election, says Dutch watchdog

https://www.theguardian.com/world/2025/oct/21/ai-chatbots-unreliable-biased-advice-voters-dutch-w...
1•uxhacker•3m ago•0 comments

Saving democracy for the price of a swimming pool

https://blog.erlend.sh/saving-democracy-for-the-price-of-a-swimming-pool
1•erlend_sh•3m ago•0 comments

Be a Potter, Not a Sculptor

https://squirrelsquadron.substack.com/p/throwing-pots-the-ipt-newsletter
1•squirrel•4m ago•0 comments

Show HN: SierraDB – A Distributed Event Store Built in Rust

https://tqwewe.com/blog/building-sierradb/
1•tqwewe•5m ago•0 comments

Exclusive club open only to the 1%

https://vole.wtf/one-percent/
2•bigjobby•5m ago•0 comments

New: Social features for Airbnb Experiences – Connect w other guests during trip

https://news.airbnb.com/introducing-social-features-for-airbnb-experiences/
2•bookofjoe•5m ago•0 comments

The Karpathy Interview, 6 Months After AI 2027

https://futuresearch.ai/ai-2027-6-months-later/
2•ddp26•7m ago•0 comments

Eli Thorkelson: On Incident Fatigue

https://decasia.org/tech/2025/08/incident-fatigue.html
1•mikece•9m ago•0 comments

Tracking Time Without Clock

https://tigerbeetle.com/blog/2025-10-21-clockless-time/
7•Bogdanp•9m ago•0 comments

Compilation of physical glitches in Sora 2

https://twitter.com/taesiri/status/1980121630040113165
1•taesiri•11m ago•0 comments

A surprise bonus from Covid-19 vaccines: bolstering cancer treatment

https://www.science.org/content/article/surprise-bonus-covid-19-vaccines-bolstering-cancer-treatment
1•rbanffy•11m ago•0 comments

Hera and Europa Clipper Will Pass Through 3I/Atlas' Tail – Universe Today

https://www.universetoday.com/articles/hera-and-europa-clipper-will-pass-through-3iatlas-tail
1•rbanffy•13m ago•0 comments

Scouts will now be able to earn badges in AI and cybersecurity

https://www.cnn.com/2025/10/14/tech/scouting-america-ai-cybersecurity-merit-badges
3•speckx•17m ago•0 comments

Ilo – a Forth system running on UEFI

https://asciinema.org/a/Lbxa2w9R5IbaJqW3INqVrbX8E
6•rickcarlino•17m ago•0 comments

My First Months in Cyberspace

https://www.gyford.com/phil/writing/2025/10/15/1995-internet/
2•vincvinc•18m ago•0 comments

Show HN: Vard – Zod-inspired prompt injection detection for TypeScript

https://github.com/andersmyrmel/vard
1•andersmyrmel•19m ago•0 comments

Show HN: Agent Spending Controls – Enforce spending limits without custody

https://github.com/L1AD/agent-spending-controls
1•liad•19m ago•0 comments

Why Trump Is Spending $20B to 'Make Argentina Great Again' [video]

https://www.youtube.com/watch?v=Lxo6Xr8u6Zk
1•mgh2•20m ago•0 comments

Fresh Developments in the Fediverse

https://www.patreon.com/posts/fresh-in-137854330
1•doener•20m ago•0 comments

Show HN: Web interface for the Gemini 2.5 Computer Use model

https://github.com/haltakov/browsafex
1•vladoh•22m ago•0 comments

Apple will let users roll back the Liquid Glass look with new 'tinted' option

https://techcrunch.com/2025/10/20/apple-will-let-users-roll-back-the-liquid-glass-look-with-new-t...
2•rbanffy•22m ago•0 comments

Microsoft fixes bug preventing users from opening classic Outlook

https://www.bleepingcomputer.com/news/microsoft/microsoft-fixes-bug-preventing-users-from-opening...
2•fleahunter•22m ago•0 comments

Show HN: Django Keel – 10 Years of Django Best Practices in One Template

https://github.com/CuriousLearner/django-keel
3•sanyam-khurana•22m ago•0 comments

Ask HN: Can SKILL.md serve as dynamic memory for Claude in each directory?

1•iosifnicolae2•23m ago•0 comments

We Saved $500k per Year by Rolling Our Own "S3"

https://engineering.nanit.com/how-we-saved-500-000-per-year-by-rolling-our-own-s3-6caec1ee1143
3•miedwar•23m ago•0 comments

Our modular, high-performance Merkle Tree library for Rust

https://github.com/bilinearlabs/rs-merkle-tree
4•bibiver•24m ago•1 comments

NASA chief suggests SpaceX may be booted from moon mission

https://www.cnn.com/2025/10/20/science/nasa-spacex-moon-landing-contract-sean-duffy
2•voxleone•24m ago•0 comments

An agent-coded search reranker

https://softwaredoug.com/blog/2025/10/19/agentic-code-generation-to-optimize-a-search-reranker
1•softwaredoug•24m ago•0 comments