R/ck_create_seed_from_hash.R

Defines functions ck_create_seed_from_hash

ck_create_seed_from_hash <- function(x) {
  hash <- sha1(x)
  hash <- unlist(strsplit(hash, ""))
  hash <- sapply(hash, function(x) {
    res <- suppressWarnings(as.numeric(x))
    ifelse(is.na(res), grep(x, letters), x)
  })
  as.integer(as.numeric(paste0("0.", paste(hash, collapse = ""))) * .Machine$integer.max)
}
sdcTools/cellKey documentation built on Aug. 21, 2019, 9:30 p.m.