All Projects → TamerShlash → Symbolized

TamerShlash / Symbolized

Licence: mit
Hash with indifferent access, with keys stored internally as symbols.

Programming Languages

ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Symbolized

Node
Stampery API for NodeJS. Notarize all your data using the blockchain
Stars: ✭ 23 (-60.34%)
Mutual labels:  hash
Hashapi Lib Node
Tierion Hash API client library for Node.js
Stars: ✭ 20 (-65.52%)
Mutual labels:  hash
Smsretrieverapimaster
Automatic SMS Verification with the SMS Retriever API
Stars: ✭ 48 (-17.24%)
Mutual labels:  hash
Hash map
Nicer way to map your hashes
Stars: ✭ 8 (-86.21%)
Mutual labels:  hash
Java Crypto Utils
Java Cryptographic, Encoding and Hash Utilities
Stars: ✭ 15 (-74.14%)
Mutual labels:  hash
Ios Category
iOS 工具分类整理
Stars: ✭ 30 (-48.28%)
Mutual labels:  hash
Hash Set
#️⃣ Set with custom equality comparisons
Stars: ✭ 6 (-89.66%)
Mutual labels:  hash
Postcss Hash Classname
PostCSS plugin to append hash string to your css class name.
Stars: ✭ 57 (-1.72%)
Mutual labels:  hash
Webpack Hashed Chunkids
a plugin to help webpack to generate unique chunk id based on unique module id
Stars: ✭ 15 (-74.14%)
Mutual labels:  hash
Wyhash Rs
wyhash fast portable non-cryptographic hashing algorithm and random number generator in Rust
Stars: ✭ 44 (-24.14%)
Mutual labels:  hash
Parallel Hashmap
A family of header-only, very fast and memory-friendly hashmap and btree containers.
Stars: ✭ 858 (+1379.31%)
Mutual labels:  hash
Flickrsync
A command line tool to synchronise, upload, download, pictures between the local file system and Flickr. Image hash signature of the picture is used to uniquely identify the image.
Stars: ✭ 14 (-75.86%)
Mutual labels:  hash
Hash Buster
Crack hashes in seconds.
Stars: ✭ 981 (+1591.38%)
Mutual labels:  hash
Jsoo router
A small router to write easily single-page-app in Js_of_ocaml
Stars: ✭ 24 (-58.62%)
Mutual labels:  hash
Hash Bench
Java Hashing, CRC and Checksum Benchmark (JMH)
Stars: ✭ 53 (-8.62%)
Mutual labels:  hash
Hashtopolis
A Hashcat wrapper for distributed hashcracking
Stars: ✭ 835 (+1339.66%)
Mutual labels:  hash
Wyhash
A pure-Go wyhash implementation.
Stars: ✭ 21 (-63.79%)
Mutual labels:  hash
Cryptonight
➿ Pure Go/ASM implementation of CryptoNight hash function with its variants, without any CGO binding.
Stars: ✭ 58 (+0%)
Mutual labels:  hash
Merkle Tools
Tools for creating Merkle trees, generating merkle proofs, and verification of merkle proofs.
Stars: ✭ 54 (-6.9%)
Mutual labels:  hash
Sparsepp
A fast, memory efficient hash map for C++
Stars: ✭ 1,021 (+1660.34%)
Mutual labels:  hash

Symbolized

Build Status

Symbolized provides a Hash with indifferent access, but with keys stored internally as symbols. This is particularly useful when you have a very big amount of hashes that share the same keys, and it may become inefficient to keep all these identical keys as strings. An example of this case is when you have data processing pipelines that process millions of hashes with the same keys.

Installation

You can either install it manually:

% [sudo] gem install symbolized

Or include it in your Gemfile:

gem 'symbolized'

And then run bundle install.

Usage

require 'symbolized'

# You can create a SymbolizedHash directly:

symbolized_hash = SymbolizedHash.new
symbolized_hash['a'] = 'b'
symbolized_hash['a'] #=> 'b'
symbolized_hash[:a]  #=> 'b'
symbolized_hash.keys #=> [:a]

# Or initialize it with a normal hash:

symbolized_hash = SymbolizedHash.new({'a' => 'b'})
symbolized_hash['a'] #=> 'b'
symbolized_hash[:a]  #=> 'b'
symbolized_hash.keys #=> [:a]

# Or use the Hash#to_symbolized_hash core extension:

h = { 'a' => 'b' }
h['a'] #=> 'b'
h[:a]  #=> nil
h.keys #=> ['a']

symbolized_hash = h.to_symbolized_hash
symbolized_hash['a'] #=> 'b'
symbolized_hash[:a]  #=> 'b'
symbolized_hash.keys #=> [:a]

The gem provides almost the same methods and functionality provided by ActiveSupport's HashWithIndifferentAccess, while storing keys internally as Symbols.

ActiveSupport Compatibility

This gem is built with intent to be as much as possible compatible with ActiveSupport. You can include both Symbolized and ActiveSupport, and you are guaranteed to get ActiveSupport functionality and core extensions, and still have Symbolized core extension and class.

Testing

Checkout travis.yml to see which Ruby versions the gem has been tested against. Alternatively, if you want to test it yourself, you can clone the repo, run bundle install and then run rake test.

Suggestions, Discussions and Issues

Please propose suggestions, open discussions, or report bugs and issues here.

Contributing

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Credits

The current code of this gem is heavily based on ActiveSupport 4.2 HashWithIndifferentAccess. Some parts are direct clones, other parts have been modified and/or refactored.

License

Copyright (c) 2015 Tamer Shlash (@TamerShlash). Released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].