David Marec 7954bbfb18 swap inplace пре 5 месеци
..
Makefile 7954bbfb18 swap inplace пре 5 месеци
README.md 7954bbfb18 swap inplace пре 5 месеци
swap16.c 7954bbfb18 swap inplace пре 5 месеци

README.md

inplace Swap bytes

Echange d'octects 2 par 2 sur un fichier, en utilisant les intrinsics.

Sur un fichier texte:

 echo '0123456789ABCDEF' > alpha
 ./swap16 --input alpha
Parsing:       17B.
Swab   :  0.000 ms.
 cat alpha
1023546798ABDCEF%

Sur un fichier plus épais:

 dd if=/dev/urandom of=/tmp/r.dummy bs=4M count=100
 cp /tmp/r.dummy /tmp/r.true
 ./swap16 --input /tmp/r.dummy
Parsing:       400M.
Swab   :  46.875 ms.
 cmp /tmp/r.dummy /tmp/r.true
/tmp/r.dummy /tmp/r.true differ: char 1, line 1
 ./swap16 --input /tmp/r.dummy
Parsing:       400M.
Swab   :  46.875 ms.
 cmp /tmp/r.dummy /tmp/r.true