
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Bitfifo implements a FIFO for 1 or more bits of an Integer. This will be needed for a compression and encryption system. Could be used for any variable length integer based problems including base64 encode/decode. Includes bit reversals for LSB first or MSB first systems. No need to worry about overfill as a Bignum is used to store bits.
Add this line to your application's Gemfile:
gem 'bitfifo'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bitfifo
A FIFO (first in first out) for variable length integers is a necessary component for data compression systems. Basically, what you put is what you get in the same order. See the example below:
# single bits:
fifo = Bitfifo.new
fifo.put true # converts true/false to 1/0
fifo.get # returns 1
# multiple bits:
fifo = Bitfifo.new
fifo.put 99, 7 # store 7 bits of the number 99
fifo.put 3,5 # store 5 bits of the number 3
fifo.put 0xffff # stores lsb bit only, others masked
fifo.count # >> 13 the number of stored bits
fifo.get 7 # >> 99
fifo.get 5 # >> 3
# reverse bits:
fifo = Bitfifo.new
fifo.rput 0b11010101, 8 # store 213 in reverse bit order
fifo.get 8 # >> 0b10101011 or 171
Bitfifo.reverse(171,8) # >> 213
# what you reverse put, you reverse get
fifo = Bitfifo.new
fifo.rput 99, 7 # store 7 bits of the number 99
fifo.rput 3,5 # store 5 bits of the number 3
fifo.rget 7 # >> 99
fifo.rget 5 # >> 3
The current methods are as follows:
# instance methods:
#count ... returns the number of stored bits
#size ... same thing as count
#put(data, nbits=nil) ... stores `nbits` of data or a single bit if `nbits` not specified
#rput(data, nbits=nil) ... reverses bit order of data, then calls #put
#get(nbits=1) ... retrieves nbits of data
#rget(nbits=1) ... retrieves nbits of data in reverse bit order
#unget(nbits=1) ... put back data from last #get or #rget. The next #get will return the same data.
#to_i ... returns internal number with size mask
#to_i(false) ... returns internal number without size mask
#empty? ... true if there is no data in FIFO
#empty ... clears all data from FIFO, returns what was cleared.
# class method:
# Bitfifo.reverse(data, nbits) ... returns reversed bit order of nbits worth of data. Other bits are masked.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
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
.
I need to control this for the time being
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that bitfifo 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.