-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Classes that sha1() should have methods for in digest #23
Comments
Already implement types:
Any ideas for the |
Same as for the other two? There is |
# the same content for differenly shaped arrays
content <- 1:8
# creates a cube 2x2x2
a <- array(content, dim = c(2,2,2))
b <- array(content, dim = c(2,4,1))
# structures to be hashed
a_tohash <- list(
dim = dim(a),
data = as.numeric(a)
)
b_tohash <- list(
dim = dim(b),
data = as.numeric(b)
)
# should produce different hashes
sha1(a_tohash)
sha1(b_tohash)
|
any other problems that need to be addressed before I create a pull request ? |
Ah, yes, of course. Well a 1:8 sequence with dim(2,2,2) is different from dim(2,4,1) so I think this is good enough. |
Unit tests maybe (in the super-simple format we use here) ? |
Note: the current implementation assumes that: |
I've just found a related section in the vignette titled "Creating a sha1 method for other classes": https://github.com/eddelbuettel/digest/blob/master/vignettes/sha1.Rmd#creating-a-sha1-method-for-other-classes Useful for new contributors. |
Any types that should also be implemented ? |
I've started this issue so everyone could add other classes to the wishlist. Keep in mind that @eddelbuettel wants to keep the list of dependencies as minimal as possible. That limits the classes to those available in base R. |
Yes, I think anything besides base R is likely to be out of scope. Unless we all agree that it is worth it. But minimal dependencies are a Good Thing (TM) for a widely-used utility package such as this. |
what about |
I love zoo and and xts -- but this would get a little out of hand. We cannot possibly follow up to every other S3 class on CRAN. Base types is good. |
#41 add sha1 methods for the pairlist and name classes. It also adds documentation for the sha1 methods on array, complex and Date |
#54 adds a sha1 method for the "function" class. e.g. |
Thanks for that. Looks like a very clean and straightforward PR. Will merge once Travis completes. |
The current implementation of |
From the top of my head I like the extra argument idea better. |
Another pair of classes that should have a method: formula and environment? Assuming that formula gets a method, I think that ideally there would be an option to ignore the attached environment (equivalent to |
The text was updated successfully, but these errors were encountered: