summaryrefslogtreecommitdiff
path: root/ext/digest/digest.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-13 11:58:05 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-13 11:58:05 +0000
commitf678390e1f7e2e8556b160202a482baa64d67f9d (patch)
treecdfbc27af6b4d5c9e070cad6198d3f5dbcb6f0f2 /ext/digest/digest.c
parent5cafaa674431aeb3bdddca88867372adbc1dbc9c (diff)
* ext/digest/digest.c (Init_digest): Digest::Base.new() does no
longer take an initial string to feed. This change allows subclasses to take hashing parameters. A statement such as ``md = Digest::MD5.new(s)'' can be easily rewritten as ``md = Digest::MD5.new << s'' or ``md = Digest::MD5.new.update(s)''. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/digest.c')
-rw-r--r--ext/digest/digest.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index fa3fd3b..d30d96f 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -259,18 +259,6 @@ rb_digest_base_lshift(VALUE self, VALUE str)
return self;
}
-static VALUE
-rb_digest_base_init(int argc, VALUE *argv, VALUE self)
-{
- VALUE arg;
-
- rb_scan_args(argc, argv, "01", &arg);
-
- if (!NIL_P(arg)) rb_digest_base_update(self, arg);
-
- return self;
-}
-
/*
* call-seq:
* digest_obj.digest -> string
@@ -402,7 +390,6 @@ Init_digest(void)
rb_define_singleton_method(cDigest_Base, "digest", rb_digest_base_s_digest, 1);
rb_define_singleton_method(cDigest_Base, "hexdigest", rb_digest_base_s_hexdigest, 1);
- rb_define_method(cDigest_Base, "initialize", rb_digest_base_init, -1);
rb_define_method(cDigest_Base, "initialize_copy", rb_digest_base_copy, 1);
rb_define_method(cDigest_Base, "reset", rb_digest_base_reset, 0);
rb_define_method(cDigest_Base, "update", rb_digest_base_update, 1);