id_shuffler 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -68,6 +68,10 @@ uint32_t g(char key[10], int k, uint32_t w)
68
68
  return (((g5<<8) + g6) & 32767); /* clip result to 15 bits */
69
69
  }
70
70
 
71
+ static VALUE r_is_big_endian(VALUE self) {
72
+ return ULONG2NUM(is_bigendian());
73
+ }
74
+
71
75
  static VALUE r_g1(VALUE self) {
72
76
  char key[10] = {1,2,3,4,5,6,7,8,9,10};
73
77
  return ULONG2NUM(g(key,1,1));
@@ -245,6 +249,7 @@ void Init_id_shuffler(void) {
245
249
  VALUE klass = rb_define_class("IdShuffler", rb_cObject);
246
250
  rb_define_singleton_method(klass, "shuffle_with_raw_key", r_base32_shuffle, 2);
247
251
  rb_define_singleton_method(klass, "unshuffle_with_raw_key", r_base32_unshuffle, 2);
252
+ rb_define_singleton_method(klass, "is_bigendian", r_is_big_endian,0);
248
253
  rb_define_singleton_method(klass, "g1", r_g1,0);
249
254
  rb_define_singleton_method(klass, "g2", r_g2,0);
250
255
  rb_define_singleton_method(klass, "skip1", r_skip1,0);
@@ -41,8 +41,4 @@ class IdShuffler
41
41
  unshuffle_with_raw_key(s.to_s, Digest::MD5.digest(key))
42
42
  end
43
43
 
44
- def self.version
45
- "0.0.4"
46
- end
47
-
48
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: id_shuffler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: