I have implemented a sanitize! method into the String class to
properly erase Strings from memory (example usage: clearing a password
from memory), but I want to make sure that what I’m doing is actually
doing what I think it is.
Basically, is this code going to leave anything lying around in
memory because of any undocumented/strange behavior or side effects of
the = method?
for i in 0…self.length
self[i] = 0
Also, feel free to recommend any “better” ways to do this.
“You get it, hm? But it’s not your head
that needs to understand!”
– Hatsumi O’Sensei