Woah! Tell me more! Not that I ever plan on knitting a scarf, but it sounds very interesting.
Discussion
Madam Defarge in A Tale of Two Cities encoded the names of the enemies of the French Revolution into her knitting (which was a "hit" list) so even Dickens knew about this.
I looked around and found this article.
My wife was telling me about it but since I don't knit myself I felt I needed to go find something with better authority than I have and this one fits the bill:
https://www.popsci.com/story/diy/secret-code-messages-knitting/
And so so fashionable.