Use get random bytes as uniqeid() is not unique in some cases

Fix #9161