I would expect this to be a library somewhere.
> import it to employers machines
How would you prove that you write the code long before getting hired by them?
Indeed. That library is often written off-the-clock by person X and imported on-the-clock by person Y.
Sometimes X === Y.
Commit it to a repo somewhere.
I have a 4 years 1 day old repo for code that was used in a job 4 years ago.
But I made sure to have a written agreement saying that the code I was bringing in was, within reasonable limits, still mine.
Clearly this doesn't include code that was produced during the job.