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.
SweatMap takes in a series of UTF-8 strings and maps them to UTF-8 strings that are as small as possible while still being unique.
Take in a series of UTF-8 strings and map them to UTF-8 strings that are as small as possible while still being unique.
The motivation behind SweatMap was to take semantic CSS Identifiers (e.g. for selectors) and make them as small as possible at build time. With new tools that can take advantage of CSS Modules all we needed was something to map our current class names to something smaller.
npm install sweatmap --save
SweatMap uses a few ES6 features that may not be present in your Node/Browser depending on the version.
These include: Array.fill
, Object.assign
, Object.freeze
, and Object.keys
Constructor(obj):
Takes in an object with up to three optional properties:
false
]: true
disallows characters that aren't safe for CSS Identifiers.object
]: An object where the key is a "range name" and the value is an object with a start character point and an end character point. You can set null to either start or end to remove a character range.{}
]: Pass in an object of strings that you don't want changed. Key is the original name, value is the name that should be used.bytes(string): Returns a byte count of the string passed in.
size(): Returns number of entries in the map.
cssSafeString(string): Determines if the string is a safe CSS Identifier.
set(string): Returns an obfuscated UTF-8 string that's unique to all strings in the map.
delete(key): Removes the string from the map.
clear(): Empties the map.
clear(): Empties the map.
entries(): Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order.
get(key): Returns the value for a given key.
get_obfuscated(value): Returns the key for a given value.
has(key): Returns true/false if a key exists in the map.
has_obfuscated(value): Returns true/false if a value exists in the map.
FAQs
SweatMap takes in a series of UTF-8 strings and maps them to UTF-8 strings that are as small as possible while still being unique.
The npm package sweatmap receives a total of 297 weekly downloads. As such, sweatmap popularity was classified as not popular.
We found that sweatmap 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.