**POSIX(Tested on zsh) + basic Linux commands 151**

    export IFS='
    '
    for f in $(ls -R1);do export n=$(echo $f|tr ' ' '_');yes n|mv $f $n || yes n|mv $f `echo $n;echo $f|md5sum`
    done