Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
This gem is about saving space and time. There is a near infinite amount of words in the english language, and many word lists can reac row counts in the millions.
Using dictionary trees with letter nodes, the largest a dictionary may get is 26 to the 26th power, which is large, but manageable. In this way words like 'cat', 'catepillar' and category may consolidate thier shared prefixes.
Add this line to your application's Gemfile:
gem 'word_zoo'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install word_zoo
This creates an active record concern module that you may include in your models:
include WordZoo
Database creation
The model that you include this in should have the following fields:
t.longblob :letters
t.longblob :word_lengths
t.string :name
input_word(word)
eg:
> example_list.input_word("lao")
=> true
> example_list.input_word("lao")
=> true
# list all words
list_words
eg:
> example_list.list_words
=> ["matt", "lao"]
def remove_word(word)
eg:
> example_list.remove_word("matt")
=> true
> example_list.list_words
=> ["lao"]
word_lengths_data
eg:
> example_list.word_lengths_data
=> {"4"=>1, "3"=>1, "6"=>1}
in this example the list_words method would return: ["matt", "matter", "lao"]: there are words of lengths 4, 3 and 6 present in the example dictionary tree.
is_word?(word)
eg:
> example_list.is_word?("matt")
=> true
> example_list.is_word?("pee")
=> false
> example_list.find_word
=> "matt"
eg:
> examplelist.tree
=> {"m"=>{"is_word"=>false, "a"=>{"is_word"=>false, "t"=>{"is_word"=>false, "t"=>{"is_word"=>true}}}}, "l"=>{"is_word"=>false, "a"=>{"is_word"=>false, "o"=>{"is_word"=>true}}}}
After pulling down the source code from github, use this in any local active record app.
gem 'word_zoo', '0.1.1', path: "../word_zoo"
Bug reports and pull requests are welcome on GitHub at https://github.com/laomatt/word_zoo. This project is intended to be a safe, welcoming space for collaboration.
Please create PRs and tag the authors.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that word_zoo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.