Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This library implements alphabetical sorting according to given alphabet scheme. Currently, only Czech alphabet is included, but it is super-easy to create a new one.
h1. Setup
Install the gem:
bc. gem install sort-by-alphabet
Or require it into Rails:
bc. gem require "sort-by-alphabet"
h1. Requirements
Support of @mb_chars@, i.e. ActiveSupport in practice.
h1. Usage
Classical sort puts accented chars after normal:
bc. %w{nazdar ahoj čau}.sort # => %w{ahoj nazdar čau}
@sort_by_alphabet@ does a better job:
bc. %w{nazdar ahoj čau}.sort_by_alphabet(CzechAlphabet) # => %w{ahoj čau nazdar}
@sort_by_alphabet@ can take a block which acts similarly as that in @sort_by@:
bc. Something.all.sort_by_alphabet(CzechAlphabet) {|o| o.title}
You can also make a class alphabetically comparable, enabling sorting:
bc.. class Something comparable_by_alphabet(CzechAlphabet) end
a = Something.new b = Something.new c = Something.new
a <=> b
[a, b, c].sort
p. or use a block, e.g. for case insensitivity:
bc. class SomethingElse comparable_by_alphabet(CzechAlphabet) {|obj| obj.mb_chars.downcase} end
FAQs
Unknown package
We found that sort-by-alphabet 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.