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.
yet_another_range_list
Advanced tools
YARL is a Ruby gem that provides efficient functionality for managing and manipulating range lists using a segment tree data structure.
Add this line to your application's Gemfile:
gem 'yet_another_range_list'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install yet_another_range_list
require 'yet_another_range_list'
rl = YARL::RangeList.new
# Add ranges
rl.add([1, 5])
rl.add([3, 8])
rl << [10, 20]
# Remove ranges
rl.remove([10, 11])
rl.delete([15, 17])
# Print the current range list (Left bound inclusive, and right bound exclusive)
rl.print
# => [1, 8) [11, 15) [17, 20)
# Get current ranges (Both bound inclusively)
rl.to_a
# => [[1, 7], [11, 14], [17, 19]]
By default the support integer range is between 0
and 4294967295
(The max number for unsigned 32bit integer), you can customize the limit when initializing a RangeList
:
rl = YARL::RangeList.new(-1000, 1000)
YARL uses a segment tree data structure to efficiently manage range operations. This allows for better performance compared to naive implementations, especially for large datasets or frequent operations.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the YARL project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that yet_another_range_list demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.