Skip to content

Instantly share code, notes, and snippets.

@VideoCarp
Last active January 31, 2024 20:27
Show Gist options
  • Save VideoCarp/100a3aca0144c5bec2a7670ee4911988 to your computer and use it in GitHub Desktop.
Save VideoCarp/100a3aca0144c5bec2a7670ee4911988 to your computer and use it in GitHub Desktop.
Making Code Uncopyable

Usage:

This is when you want to create an open-source project in which you may not want the people to be
able to just copy it, in that case you can make it uncopyable.

How do I do it?

Finding the Character

You will use a special unicode character. No, it will not make your code look any different, however,
it'll raise syntax errors. There are multiple characters, so to be PERFECTLY safe, use as many as possible.
Below, is a table for them

Character Copy Full Char Name
ZWJ Copy Zero Width Joiner
ZWNJ Copy Zero Width Non-Joiner
ZWNBS Copy Zero Width No-Break Space

The supreme one (totally not because I couldn't figure out how to extend the table) is the Zero-Width Space.
The Zero-Width space looks exactly like the other ones, so do add it.

I've got it, how do I continue?

Making it 3

  1. Paste the character 3 times.
  2. Copy the 3 characters you've got.

Where to put it?

Now, I'd recommend putting it in completely random areas to confuse the plagiarizer.
Put it in as many lines as possible in COMPLETELY random places in the lines.
The plagiarizer will except the code to work, however they may be smart enough to check
for some of the characters, and that's where hairspaces come in.
They're tiny spaces, however you can see them, thats why you replace certain REAL spaces with about 5 of them, and
trick the plagiarized.

Be certain to add as many zero width characters as possible, and try using whitespace unicode characters to your
advantage. Zero-Width characters are VERY useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment