
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
beacon-tool
Advanced tools
Collection of bluetooth beacon signal utility functions.
Beacon Tool allows you to generate, inspect and validate various bluetooth beacon payloads.
Via NPM:
npm i [-g] beacon-tool
Via Yarn:
yarn [global] add beacon-tool
beaconTool.generate(format, [pretty])
Generates a payload for the given format.
(string, [boolean]) => string
string
The format to generate.
'ibeacon'
: Generates an 'iBeacon' UUID.'altbeacon'
: Generates an AltBeacon BeaconID.'eddystoneuid'
: Generates an Eddystone namespace-instance ID pair.These strings are exposed as constants in beaconTool.signals
.
boolean
optionalfalse
Whether or not to to add dashes to the returned payload string.
See beatify()
for further information.
string
A payload string for the given result.
const beaconTool = require('beacon-tool');
const uuid = beaconTool.generate(beaconTool.signals.iBeacon.key);
console.log(uuid);
// de93f975b5d74c9ea8a606fd7cf9d45b
const prettyUUID = beaconTool.generate(beaconTool.signals.iBeacon.key);
console.log(prettyUUID);
// de93f975-b5d7-4c9e-a8a6-06fd7cf9d45b
beaconTool.validate(payload, format)
Validates a signal payload against a given format.
(string, string) => boolean
string
The payload to validate.
string
The format to generate.
See Recognized Formats for information on format specification.
boolean
Whether or not the given payload is valid for the given format.
const beaconTool = require('beacon-tool');
const isValidIBeacon = beaconTool.validate(
'259771A0-2DFB-4554-B817-2FBFDB5DB1A7',
beaconTool.signals.iBeacon.key
);
if (isValidIBeacon) {
console.info('valid');
} else {
console.info('error');
}
beaconTool.beautify(payload, format)
Beautifies, i.e. adds dashes, to a given payload. beautify()
returns a new string.
AltBeacon specification does not specify any representation of it's beacon id with dashes, therefore beautifying an AltBeacon payload will not have any effect.
(string, string) => string
string
The payload to beatify.
string
The payload format.
See Recognized Formats for information on format specification.
string
The beatified payload.
const beaconTool = require('beacon-tool');
const beautifiedPayload = beaconTool.beatify(
'DE93F975B5D74C9EA8A606FD7CF9D45B',
beaconTool.signals.iBeacon.key
);
console.log(beatifiedPayload);
// DE93F975-B5D7-4C9E-A8A6-06FD7CF9D45B
beaconTool.identify(payload)
Tries to identify a given payload.
(string) => array
const beaconTool = require('beacon-tool');
const candidates = beaconTool.identify('DE93F975-B5D7-4C9E-A8A6-06FD7CF9D45B');
candidates.forEach((candidate) => {
console.info(`${beaconTool.get(candidate).displayName}`);
});
// iBeacon
string
The payload to identify.
array
An array of potential candidates. The returned array contains the keys
of potential candiate formats.
beaconTool.get(format)
Retrieves information about a given format.
(string) => object
string
The format to retrieve information for.
See Recognized Formats for information on format specification.
object
A signal information object.
See signals for futher information.
const beaconTool = require('beacon-tool');
console.log(beaconTool.get('ibeacon'));
/**
{
dashes: [8, 12, 16, 20],
displayName: 'iBeacon',
key: 'ibeacon',
length: 32
}
*/
beaconTool.signals
Beacon signal constants.
const beaconTool = require('beacon-tool');
console.log(beaconTool.signals);
/**
{
altBeacon: {
displayName: 'AltBeacon',
key: 'altbeacon',
length: 40
},
iBeacon: {
dashes: [8, 12, 16, 20],
displayName: 'iBeacon',
key: 'ibeacon',
length: 32
},
eddystoneUid: {
dashes: [20],
displayName: 'Eddystone UID',
instanceId: {
length: 12
},
key: 'eddystoneuid',
length: 32,
namespace: {
length: 20
}
}
}
*/
FAQs
Collection of bluetooth beaconing tools.
The npm package beacon-tool receives a total of 10 weekly downloads. As such, beacon-tool popularity was classified as not popular.
We found that beacon-tool 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.