
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
driver-license-validator
Advanced tools
Validate driver license numbers. Formats based on https://ntsi.com/drivers-license-format/.
npm install driver-license-validator --save
import { getMatches, isValid } from 'driver-license-validator';
isValid('A1234567');
// => true
isValid('invalid_dl');
// => false
getMatches('A1234567');
// => [
// { description: '1 letter followed by 1-8 numbers', state: 'AZ' },
// { description: '1 letter followed by 7 numbers', state: 'CA' },
// { description: '1 letter followed by 5-9 numbers', state: 'MO' },
// { description: '1 letter followed by 6-8 numbers', state: 'NE' },
// { description: '1 letter followed by 7 numbers', state: 'NY' },
// { description: '1 letter followed by 4-8 numbers', state: 'OH' }
// ]
getMatches('A1234567', { states: 'NY' });
// => [
// { description: '1 letter followed by 7 numbers', state: 'NY' }
// ]
getMatches('A1234567', { states: ['NY', 'OH'] });
// => [
// { description: '1 letter followed by 7 numbers', state: 'NY' },
// { description: '1 letter followed by 4-8 numbers', state: 'OH' }
// ]
getMatches('A123456789', { country: 'CA' });
// => [
// { description: '1 letter followed by 9 numbers', state: 'NL' }
// ]
getMatches('invalid_dl');
// => null
Options:
Option | Type | Description | Default |
---|---|---|---|
country | string | Country to use. | US |
states | string or string[] | State(s) to filter results to. | n/a |
ignoreCase | boolean | True to ignore case. | false |
npm install
npm run build
FAQs
Validate driver license numbers.
The npm package driver-license-validator receives a total of 3,593 weekly downloads. As such, driver-license-validator popularity was classified as popular.
We found that driver-license-validator 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.