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.
com.michellemay:url-lang-id
Advanced tools
Detect common language patterns in URLs.
<dependency>
<groupId>com.michellemay</groupId>
<artifactId>url-lang-id</artifactId>
<version>0.1.1</version>
</dependency>
Complete sample with built-in config defaults:
// Create builder and detector
URLLanguageDetectorBuilder builder = URLLanguageDetectorBuilder.create(ConfigReader.readBuiltIn());
URLLanguageDetector detector = builder.create();
// Extract language from url:
Optional<Locale> lang = detector.detect("http://en.site.org/");
Read configuration from InputStream:
InputStream stream = ...
Config config = ConfigReader.read(stream, "utf-8");
Read configuration from String:
String jsonConfig = "..."
Config config = ConfigReader.read(jsonConfig);
Mappings attributes:
Default mappings built from Java Locale:
Matchers attributes:
Default matchers:
Profiles attributes:
Mappings are selected in the following order:
{
"mappings":[
{
"name":"all",
"extend":["ISO-639-ALPHA-2","ISO-639-ALPHA-3","LANGUAGE_TAGS","ENGLISH_NAMES"]
},
{
"name":"ISO-639-CODES",
"extend":["ISO-639-ALPHA-2","ISO-639-ALPHA-3"]
}
],
"matchers":[
{
"name":"hostname",
"urlpart":"hostname",
"patterns":["(?<lang>[^\\.]+)(\\.[^\\.]+){2,}"]
},
{
"name":"path",
"urlpart":"path",
"patterns":["/(?<lang>[^/]+)(/.*)?"]
},
{
"name":"querystring",
"urlpart":"querystring",
"patterns":["lang(uage)?=(?<lang>.*)"]
}
],
"profiles": [
{
"name":"default",
"domains":[".*"],
"mapping":"ISO-639-CODES",
"matchers":[
{
"matcher":"hostname"
},
{
"matcher":"path"
},
{
"matcher":"querystring",
"mapping":"all"
}
]
}
]
}
FAQs
URL Language Detection Library for Java.
We found that com.michellemay:url-lang-id demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.