Skip to content

Commit

Permalink
use the correct mask to restrict result to 3 significant bytes (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamis committed Jul 20, 2023
1 parent ceb72f6 commit 1d1b725
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/bson/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void Init_bson_native()
rb_bson_generate_machine_id(rb_md5_class, rb_bson_machine_id);

// Set the object id counter to a random 3-byte integer
rb_bson_object_id_counter = pvt_rand() % 0x1000000;
rb_bson_object_id_counter = pvt_rand() % 0xFFFFFF;

rb_bson_registry = rb_const_get(rb_bson_module, rb_intern("Registry"));
rb_gc_register_mark_object(rb_bson_registry);
Expand Down

0 comments on commit 1d1b725

Please sign in to comment.