Update for new CRAN policies · rstudio/rscrypt@9b92a0a · GitHub
Skip to content

Commit 9b92a0a

Browse files
committed
Update for new CRAN policies
CRAN policies have changed between previous release and now, see the discussion on the Rcpp GitHub issue page: RcppCore/Rcpp#636 These mostly automated changes ensure that this package conforms to the new CRAN standard. The change to NAMESPACE was the only one done manually.
1 parent 9c8290d commit 9b92a0a

4 files changed

Lines changed: 29 additions & 17 deletions

File tree

‎NAMESPACE‎

Lines changed: 1 addition & 1 deletion

‎R/RcppExports.R‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#' @seealso \code{\link{verifyPassword}}
1919
#' @export
2020
hashPassword <- function(passwd, maxmem = 0.1, maxtime = 1.0) {
21-
.Call('scrypt_hashPassword', PACKAGE = 'scrypt', passwd, maxmem, maxtime)
21+
.Call(`_scrypt_hashPassword`, passwd, maxmem, maxtime)
2222
}
2323

2424
#' Verify a hashed password
@@ -33,22 +33,22 @@ hashPassword <- function(passwd, maxmem = 0.1, maxtime = 1.0) {
3333
#'
3434
#' # verify invalid password
3535
#' verifyPassword(hashed, "bad password");
36-
#'
37-
#' # verify correct password
36+
#'
37+
#' # verify correct password
3838
#' verifyPassword(hashed, "password")
39-
#'
39+
#'
4040
#' @seealso {
4141
#' \code{\link{hashPassword}}
4242
#' }
4343
#' @export
4444
verifyPassword <- function(hash, passwd) {
45-
.Call('scrypt_verifyPassword', PACKAGE = 'scrypt', hash, passwd)
45+
.Call(`_scrypt_verifyPassword`, hash, passwd)
4646
}
4747

4848
#' @importFrom Rcpp evalCpp
4949
#' @useDynLib scrypt
5050
#' @export
5151
scrypt <- function(passwd, salt, n, r, p, length = 64L) {
52-
.Call('scrypt_scrypt', PACKAGE = 'scrypt', passwd, salt, n, r, p, length)
52+
.Call(`_scrypt_scrypt`, passwd, salt, n, r, p, length)
5353
}
5454

‎src/RcppExports.cpp‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using namespace Rcpp;
77

88
// hashPassword
99
CharacterVector hashPassword(const std::string& passwd, double maxmem, double maxtime);
10-
RcppExport SEXP scrypt_hashPassword(SEXP passwdSEXP, SEXP maxmemSEXP, SEXP maxtimeSEXP) {
10+
RcppExport SEXP _scrypt_hashPassword(SEXP passwdSEXP, SEXP maxmemSEXP, SEXP maxtimeSEXP) {
1111
BEGIN_RCPP
1212
Rcpp::RObject rcpp_result_gen;
1313
Rcpp::RNGScope rcpp_rngScope_gen;
@@ -20,7 +20,7 @@ END_RCPP
2020
}
2121
// verifyPassword
2222
bool verifyPassword(const std::string& hash, const std::string& passwd);
23-
RcppExport SEXP scrypt_verifyPassword(SEXP hashSEXP, SEXP passwdSEXP) {
23+
RcppExport SEXP _scrypt_verifyPassword(SEXP hashSEXP, SEXP passwdSEXP) {
2424
BEGIN_RCPP
2525
Rcpp::RObject rcpp_result_gen;
2626
Rcpp::RNGScope rcpp_rngScope_gen;
@@ -32,7 +32,7 @@ END_RCPP
3232
}
3333
// scrypt
3434
RawVector scrypt(RawVector passwd, RawVector salt, uint32_t n, uint32_t r, uint32_t p, uint32_t length);
35-
RcppExport SEXP scrypt_scrypt(SEXP passwdSEXP, SEXP saltSEXP, SEXP nSEXP, SEXP rSEXP, SEXP pSEXP, SEXP lengthSEXP) {
35+
RcppExport SEXP _scrypt_scrypt(SEXP passwdSEXP, SEXP saltSEXP, SEXP nSEXP, SEXP rSEXP, SEXP pSEXP, SEXP lengthSEXP) {
3636
BEGIN_RCPP
3737
Rcpp::RObject rcpp_result_gen;
3838
Rcpp::RNGScope rcpp_rngScope_gen;
@@ -46,3 +46,15 @@ BEGIN_RCPP
4646
return rcpp_result_gen;
4747
END_RCPP
4848
}
49+
50+
static const R_CallMethodDef CallEntries[] = {
51+
{"_scrypt_hashPassword", (DL_FUNC) &_scrypt_hashPassword, 3},
52+
{"_scrypt_verifyPassword", (DL_FUNC) &_scrypt_verifyPassword, 2},
53+
{"_scrypt_scrypt", (DL_FUNC) &_scrypt_scrypt, 6},
54+
{NULL, NULL, 0}
55+
};
56+
57+
RcppExport void R_init_scrypt(DllInfo *dll) {
58+
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
59+
R_useDynamicSymbols(dll, FALSE);
60+
}

‎src/scrypt.cpp‎

Lines changed: 7 additions & 7 deletions

0 commit comments

Comments
 (0)