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.
A basic first-in-first-out (FIFO) queue data structure.
It supports the usual enqueue and dequeue operations, along with methods for peeking at the first item, testing if the queue is empty, clearing the queue and counting the number of items in the queue.
This implementation uses a singly-linked list with a non-static nested class for linked-list nodes. As a result, this data structure is more performant than implementing a queue with an array (see notes below).
Add this line to your application's Gemfile:
gem 'basic_queue'
And then execute:
$ bundle
Or install it yourself as:
$ gem install basic_queue
Create a new instance of Queue
:
queue = BasicQueue::Queue.new
Add items to the queue:
queue.enq 'Michael'
queue << 'Peter' # << is an alias method for enq(), you can use either method
Check which item is next in the queue:
queue.peek
=> "Michael"
Remove item from the queue:
queue.deq
=> "Michael"
Check number of items left in the queue:
queue.length # size() is an alias method for length, you can use either method
=> 1
Clear queue:
queue.clear
All methods take constant time (Θ(1)). Hence, using this data structure is more performant than using an Array since Array#unshift takes linear time (Θ(n)).
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that basic_queue demonstrated a not healthy version release cadence and project activity because the last version was released 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.