radix alternatives and similar shards
Based on the "Algorithms and Data structures" category.
Alternatively, view radix alternatives based on common mentions on social networks and blogs.
crystalline9.0 0.0 radix VS crystallineA collection of containers & algorithms for the Crystal programming language
CrOTP8.0 0.7 radix VS CrOTPCrOTP - One Time Passwords for Crystal
fzy6.7 0.0 radix VS fzyA Crystal port of awesome Fzy project, a fuzzy finder algorithm.
crystalg6.5 0.0 radix VS crystalgAlgorithm Library for Crystal
bitfields5.9 0.0 radix VS bitfieldsBit Fields for Crystal Language
crystaledge5.9 0.0 radix VS crystaledgeA pure Crystal Vector Math library
qr-code5.2 0.0 radix VS qr-codea QR Code implementation written in crystal lang
graphlb4.9 0.0 radix VS graphlbgraphlb is a crystal library which contains all the graph Data-Structures and Algorithms implemented in crystal-lang.
markov4.8 0.0 radix VS markov⛓ A Crystal library for building Markov Chains and running Markov Processes.
blurhash.cr4.6 0.0 radix VS blurhash.crA pure Crystal implementation of BlurHash algorithm
kd_tree4.5 0.0 radix VS kd_treeCrystal implementation of "K-Dimensional Tree" and "N-Nearest Neighbors"
crystal-linked-list4.5 0.0 radix VS crystal-linked-listSimple linked list implementation in Crystal
text4.5 0.0 radix VS textA collection of phonetic algorithms for Crystal. Including; Porter-Stemmer, Soundex, Metaphone, Double Metaphone & White Similarity
crie4.2 0.0 radix VS crieCompile-time Trie in Crystal
haversine4.0 0.0 radix VS haversineCrystal implementation of the Haversine formula to calculate distances between two points given their latitudes and longitudes
Goban4.0 10.0 radix VS GobanA fast and efficient QR/Micro QR/rMQR Code implementation in Crystal lang
ksuid.cr3.8 0.0 radix VS ksuid.crCrystal implementation of K-Sortable Globally Unique IDs
csuuid3.8 2.1 radix VS csuuidThis is a small UUID library that implements a chronologically sortable UUID.
edits.cr3.8 0.0 radix VS edits.crEdit distance algorithms inc. Jaro, Damerau-Levenshtein, and Optimal Alignment
splay_tree_map3.8 0.0 radix VS splay_tree_mapThis is a Crystal implementation of a Splay Tree; which is a type of binary search tree that is semi-balanced and that tends to self-optimize so that the most accessed items are the fastest to retrieve.
delimiter_tree3.6 0.0 radix VS delimiter_treeA crystal-lang tree structure that is built using a delimiter.
murmur33.6 0.0 radix VS murmur3Crystal implementation of Murmur3 hash algorithm used by Cassandra
ternary_search_tree3.5 0.0 radix VS ternary_search_treeA Crystal implementation of a Ternary Search Tree
bisect3.2 0.0 radix VS bisectLibrary for maintaining sorted Arrays
hash_ring2.4 0.0 radix VS hash_ringImplementation of Consistent Hash Ring for Crystal
secure-remote-password2.3 3.9 radix VS secure-remote-passwordCrystal implementation of the Secure Remote Password protocol (SRP-6a)
miller_rabin2.3 0.0 radix VS miller_rabinMiller-Rabin algorithm for prime checking
aho_corasick2.3 0.0 radix VS aho_corasickaho_corasick for crystal-lang
multiset.cr2.2 0.0 radix VS multiset.crMultiset (bag) implementation in Crystal
heap.cr2.0 0.0 radix VS heap.crdata structure heap for crystal-lang
primes1.8 0.0 radix VS primesLibrary for testing primality and factoring integers in Crystal
ranger1.8 0.0 radix VS rangerRange object operation in Crystal
s2_cells1.7 0.0 radix VS s2_cellsmaps latitude and longitude to S2 Cells https://s2geometry.io/
Access the most powerful time series database as a service
Do you think we are missing an alternative of radix or a related project?
Radix tree implementation for Crystal language
Add this to your application's
dependencies: radix: github: luislavena/radix
You can associate a payload with each path added to the tree:
require "radix" tree = Radix::Tree(Symbol).new tree.add "/products", :products tree.add "/products/featured", :featured result = tree.find "/products/featured" if result.found? puts result.payload # => :featured end
The types allowed for payload are defined on Tree definition:
tree = Radix::Tree(Symbol).new # Good, since Symbol is allowed as payload tree.add "/", :root # Compilation error, Int32 is not allowed tree.add "/meaning-of-life", 42
Can combine multiple types if needed:
tree = Radix::Tree(Int32 | String | Symbol).new tree.add "/", :root tree.add "/meaning-of-life", 42 tree.add "/hello", "world"
Lookup and placeholders
You can also extract values from placeholders (as named segments or globbing):
tree.add "/products/:id", :product result = tree.find "/products/1234" if result.found? puts result.params["id"]? # => "1234" end
Radix::Tree#add documentation for more usage examples.
Pretty much all Radix implementations have their limitations and this project is no exception.
When designing and adding paths to a Tree, please consider that two different named parameters cannot share the same level:
tree.add "/", :root tree.add "/:post", :post tree.add "/:category/:post", :category_post # => Radix::Tree::SharedKeyError
This is because different named parameters at the same level will result in
params when lookup is performed, and sometimes the value for
category parameters will not be stored as expected.
To avoid this issue, usage of explicit keys that differentiate each path is recommended.
For example, following a good SEO practice will be consider
absolute permalink for the post and have a list of categories which links to
the permalinks of the posts under that category:
tree.add "/", :root tree.add "/:post", :post # this is post permalink tree.add "/categories", :categories # list of categories tree.add "/categories/:category", :category # listing of posts under each category
This project has been inspired and adapted from julienschmidt/httprouter and spriet2000/vertx-http-router Go and Java implementations, respectively.
Changes to logic and optimizations have been made to take advantage of Crystal's features.
- Fork it ( https://github.com/luislavena/radix/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
- Luis Lavena - creator, maintainer