<commit_before>Classy Hash
===========

### Keep Your Hashes Classy (a lightweight Hash validation gem)

Classy Hash is a lightweight RubyGem for validating Ruby hashes against a
simple schema Hash that indicates what data types are expected.  Classy Hash
will make sure your data matches, providing helpful error messages if it
doesn't.

Classy Hash is fantastic for helping developers become familiar with an API, by
letting them know exactly what they did wrong.  It also guards against mistakes
by verifying that incoming data meets expectations, and can serve as a
convenient data structure documentation format.

### Why Classy Hash?

Classy Hash was created as a lightweight alternative to the other good
validation gems available.  By taking advantage of built-in Ruby language
features, Classy Hash can validate common Hashes much faster than some of the
other gems we tested, with a dead simple schema syntax.

Classy Hash doesn't modify your Hashes or patch any core classes, so it's safe
to use just about anywhere.

Classy Hash is thoroughly tested (see the **Testing** section below).

Finally, Classy Hash is blazingly fast:

```
      Serializer      |      Validator       |  Ops/sec
----------------------+----------------------+-----------
 msgpack              | no_op                | 127560
 msgpack              | classy_hash          | 71201
 msgpack              | classy_hash_strict   | 61102
 msgpack              | hash_validator       | 27950
 msgpack              | schema_hash          | 22227
 msgpack              | json_schema          | 1302
 msgpack              | json_schema_strict   | 1301
 msgpack              | json_schema_full     | 1280
```

<commit_msg>Updated README with current benchmark numbers.<commit_after>Classy Hash
===========

### Keep Your Hashes Classy (a lightweight Hash validation gem)

Classy Hash is a lightweight RubyGem for validating Ruby hashes against a
simple schema Hash that indicates what data types are expected.  Classy Hash
will make sure your data matches, providing helpful error messages if it
doesn't.

Classy Hash is fantastic for helping developers become familiar with an API, by
letting them know exactly what they did wrong.  It also guards against mistakes
by verifying that incoming data meets expectations, and can serve as a
convenient data structure documentation format.

### Why Classy Hash?

Classy Hash was created as a lightweight alternative to the other good
validation gems available.  By taking advantage of built-in Ruby language
features, Classy Hash can validate common Hashes much faster than some of the
other gems we tested, with a dead simple schema syntax.

Classy Hash doesn't modify your Hashes or patch any core classes, so it's safe
to use just about anywhere.

Classy Hash is thoroughly tested (see the **Testing** section below).

Finally, Classy Hash is blazingly fast:

```
      Serializer      |      Validator       |  Ops/sec
----------------------+----------------------+-----------
 msgpack              | no_op                | 123525
 msgpack              | classy_hash          | 67798
 msgpack              | classy_hash_strict   | 59952
 msgpack              | hash_validator       | 27578
 msgpack              | schema_hash          | 22217
 msgpack              | json_schema          | 1255
 msgpack              | json_schema_full     | 1251
 msgpack              | json_schema_strict   | 1086
```


{'fraction_non_alphanumeric': 0.07669874599008457, 'fraction_numerical': 0.02216389617964421, 'mean_word_length': 2.4472361809045227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '30390', 'n_tokens_mistral': 890, 'n_tokens_neox': 796, 'n_words': 407}