As you can tell from this question and my previous one, I am determined to kill my SSD.
Let's write the shortest code to perform a simplified variant of the DoD 5220.22-M Wipe Method with only two writing passes.
Any programming language accepted, but the use of disk-wiping-oriented libraries is prohibited.
Here's how we are to implement it in pseudocode:
Set x to 0
[Start]
'Write Pass
For each sector in disk write the content of x
'Verification Pass
For each sector in disk {
If sector does not contain the content of x then goto [Start]
}
'Check whether we already did the pass with 1
If x is not 1 then {
Set x to 1
GoTo [Start]
}
Else end
In other words, this code will run twice, with a write pass and verification pass for 0
, and a write pass and verification pass for 1
.
Anyone ballsy enough to implement it code-golf style? ;)