Sha256: 32830dc23f4e279f46383700eec9afd7a51a83d4734c123a28bf5cbbf3a3718e

Contents?: true

Size: 542 Bytes

Versions: 3

Compression:

Stored size: 542 Bytes

Contents

#include <ruby.h>
#include "libxxhash.h"

// Use this typedef to make the compiler happy when
// calling rb_define_method()
typedef VALUE (ruby_method)(...);

extern "C" VALUE xxhash_xxh32(VALUE mod, VALUE input, VALUE seed)
{
  return ULL2NUM(XXH32(StringValuePtr(input), RSTRING_LEN(input), NUM2ULL(seed)));
}

extern "C" void Init_xxhash()
{
  VALUE mXXhash = rb_define_module("XXhash");
  VALUE mInternal = rb_define_module_under(mXXhash, "Internal");

  rb_define_singleton_method(mInternal, "xxh32", (ruby_method*) &xxhash_xxh32, 2);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xxhash-0.1.1 ext/xxhash/xxhash.cc
xxhash-0.1.0 ext/xxhash/xxhash.cc
xxhash-0.0.1 ext/xxhash/xxhash.cc