Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A Ruby implementation of go-identicon by Damian Gryski
RubyIdenticon creates an identicon, similar to those created by Github.
A title and key are used by siphash to calculate a hash value that is then used to create a visual identicon representation. The identicon is made by creating a left hand side pixel representation of each bit in the hash value - this is then mirrored onto the right hand side to create an image that we see as a shape. The grid and square sizes can be varied to create identicons of differing size.
Add this line to your application's Gemfile:
gem 'ruby_identicon'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ruby_identicon
Creating an identicon and saving to png
RubyIdenticon.create_and_save("RubyIdenticon", "ruby_identicon.png")
Creating an identicon and returning a binary string
blob = RubyIdenticon.create("RubyIdenticon")
# optional, save to a file
File.open("ruby_identicon.png", "wb") do |f| f.write(blob) end
Creating an identicon and returns in base64 format
base64_identicon = RubyIdenticon.create_base64("RubyIdenticon")
nb// to render this in html pass the base64 code into your view
raw "<img src='data:image/png;base64,#{base64_identicon}'>"
The identicon can be customised by passing additional options
background_color: (Integer, default 0) the background color of the identicon in rgba notation (e.g. 0xffffffff for white)
border_size: (Integer, default 35) the size in pixels to leave as an empty border around the identicon image
grid_size: (Integer, default 7) the number of rows and columns in the identicon, minimum 4, maximum 9
square_size: (Integer, default 50) the size in pixels of each square that makes up the identicon
key: (String) a 16 byte key used by siphash when calculating the hash value (see note below)
Varying the key ensures uniqueness of an identicon for a given title, it is assumed desirable for different applications
to use a different key.
Example
blob = RubyIdenticon.create("identicons are great!", grid_size: 5, square_size: 70, background_color: 0xf0f0f0ff, key: "1234567890123456")
File.open("tmp/test_identicon.png", "wb") do |f| f.write(blob) end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that ruby_identicon 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.