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.
github.com/nyaruka/phonenumbers
golang port of Google's libphonenumber forked from libphonenumber from ttacon/libphonenumber. This library is used daily in production for parsing and validation of numbers across the world, so is well maintained. Please open an issue if you encounter any problems, we'll do our best to address them.
[!IMPORTANT] The aim of this project is strictly to be a port and match as closely as possible the functionality in libphonenumber. Please don't submit feature requests for functionality that doesn't exist in libphonenumber.
[!IMPORTANT] We use the metadata from libphonenumber so if you encounter unexpected parsing results, please first verify if the problem affects libphonenumber and report there if so. You can use their online demo to quickly check parsing results.
As we don't want to bump our major semantic version number in step with the upstream library, we use independent version numbers than the Google libphonenumber repo. The release notes will mention what version of the metadata a release was built against.
// parse our phone number
num, err := phonenumbers.Parse("6502530000", "US")
// format it using national format
formattedNum := phonenumbers.Format(num, phonenumbers.NATIONAL)
The buildmetadata
command will fetch the latest XML file from the official Google repo and rebuild the go source files
containing all the territory metadata, timezone and region maps.
It will rebuild the following files:
gen/metadata_bin.go
- protocol buffer definitions for all the various formats across countries etc..gen/shortnumber_metadata_bin.go
- protocol buffer definitions for ShortNumberMetadata.xmlgen/countrycode_to_region_bin.go
- information needed to map a contry code to a regiongen/prefix_to_carrier_bin.go
- information needed to map a phone number prefix to a carriergen/prefix_to_geocoding_bin.go
- information needed to map a phone number prefix to a city or regiongen/prefix_to_timezone_bin.go
- information needed to map a phone number prefix to a city or region% go install github.com/nyaruka/phonenumbers/cmd/buildmetadata
% $GOPATH/bin/buildmetadata
FAQs
Unknown package
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.