89 static const char hex[] = {
90 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
91 'a',
'b',
'c',
'd',
'e',
'f'
104 for (i = 0, p =
RSTRING_PTR(str); i < digest_len; i++) {
105 unsigned char byte = digest[
i];
107 p[i +
i] = hex[byte >> 4];
108 p[i + i + 1] = hex[byte & 0x0f];
324 size_t digest_len = 32;
549 if (copy == obj)
return copy;
static VALUE rb_digest_base_finish(VALUE self)
static VALUE rb_digest_instance_finish(VALUE self)
static VALUE rb_digest_base_update(VALUE self, VALUE str)
size_t strlen(const char *)
const char * rb_obj_classname(VALUE)
static VALUE rb_digest_class_s_digest(int argc, VALUE *argv, VALUE klass)
void rb_define_singleton_method(VALUE obj, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a singleton method for obj.
VALUE rb_str_buf_append(VALUE, VALUE)
int rb_str_cmp(VALUE, VALUE)
#define rb_check_frozen(obj)
void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
static VALUE rb_digest_instance_digest_bang(VALUE self)
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
static VALUE rb_digest_s_hexencode(VALUE klass, VALUE str)
VALUE rb_str_buf_cat2(VALUE, const char *)
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_obj_class(VALUE)
static VALUE rb_digest_instance_inspect(VALUE self)
void rb_include_module(VALUE klass, VALUE module)
static VALUE rb_cDigest_Class
VALUE rb_ivar_get(VALUE, ID)
static VALUE rb_digest_instance_hexdigest_bang(VALUE self)
VALUE rb_usascii_str_new(const char *, long)
static VALUE rb_digest_instance_block_length(VALUE self)
static VALUE rb_digest_base_block_length(VALUE self)
return Data_Wrap_Struct(CLASS_OF(interp), 0, ip_free, slave)
static VALUE rb_digest_instance_to_s(VALUE self)
static VALUE rb_mDigest_Instance
static VALUE hexencode_str_new(VALUE str_digest)
static ID id_digest_length
void rb_define_module_function(VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a module function for module.
VALUE rb_obj_clone(VALUE)
static VALUE rb_digest_class_init(VALUE self)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
VALUE rb_str_buf_new(long)
static VALUE rb_digest_instance_hexdigest(int argc, VALUE *argv, VALUE self)
static VALUE rb_digest_base_alloc(VALUE klass)
VALUE rb_ivar_defined(VALUE, ID)
VALUE rb_define_module_under(VALUE outer, const char *name)
static VALUE rb_digest_instance_new(VALUE self)
static VALUE rb_digest_base_copy(VALUE copy, VALUE obj)
VALUE rb_obj_is_kind_of(VALUE, VALUE)
static VALUE rb_digest_instance_reset(VALUE self)
RUBY_EXTERN VALUE rb_cObject
#define Data_Get_Struct(obj, type, sval)
static rb_digest_metadata_t * get_digest_base_metadata(VALUE klass)
static VALUE rb_digest_instance_length(VALUE self)
static VALUE rb_digest_instance_update(VALUE self, VALUE str)
VALUE rb_str_new(const char *, long)
static VALUE rb_digest_base_reset(VALUE self)
static VALUE rb_digest_instance_digest_length(VALUE self)
VALUE rb_obj_alloc(VALUE)
VALUE rb_funcall2(VALUE, ID, int, const VALUE *)
Calls a method.
RUBY_EXTERN void Init_digest_base(void)
VALUE rb_define_module(const char *name)
static VALUE rb_digest_instance_equal(VALUE self, VALUE other)
static void rb_digest_instance_method_unimpl(VALUE self, const char *method)
void rb_obj_call_init(VALUE obj, int argc, VALUE *argv)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
static VALUE rb_digest_class_s_hexdigest(int argc, VALUE *argv, VALUE klass)
static VALUE rb_cDigest_Base
VALUE rb_class_superclass(VALUE)
static VALUE rb_digest_base_digest_length(VALUE self)
static VALUE rb_digest_instance_digest(int argc, VALUE *argv, VALUE self)