Just for fun:
set.seed.alpha <- function(x) {
require("digest")
hexval <- paste0("0x",digest(x,"crc32"))
intval <- type.convert(hexval) %% .Machine$integer.max
set.seed(intval)
}
So you can do:
set.seed.alpha("hello world")
(in fact x
can be any R object, not just an alphanumeric string)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…