wood shavings are safe if killin dried, which it needs to be for humans let alone hamsters, but sawdust is a bit 50-50
i was always told not to use it, and its bad for them, but I know one of the longest running hamsterys use sawdust for their LH males
you need to sieve out the dust, which is time consuming, can make your hands hurt and you end up throwing loads out as unusable dust, but the left over micro flakes are safe.
un sieved it can be breathed in and can give them resparitory infections
its too much bother for me to sieve sawdust, i use shavings/megazorb/fitch/carefresh