npm.io
2.1.2 • Published 1 week ago

oui-data

Licence
BSD-2-Clause
Version
2.1.2
Deps
0
Size
5.4 MB
Vulns
0
Weekly
0
Stars
18

oui-data

IEEE OUI database as JSON

Example

The module exports a JSON file. Depending on your environment you may need to use import attributes, import assertions or nothing at all.

Keys cover all three IEEE registries, MA-L with 6 hex chars, MA-M with 7 and MA-S with 9. MA-M and MA-S are subdivisions of MA-L prefixes assigned to IEEE Registration Authority, so match the longest prefix first:

import ouiData from "oui-data" with {type: "json"};

const mac = "C85CE27ABCDE";
console.log(ouiData[mac.substring(0, 9)] ?? ouiData[mac.substring(0, 7)] ?? ouiData[mac.substring(0, 6)]);
//=> SYNERGY SYSTEMS AND SOLUTIONS
//=> A1526, GREEN FIELDS COLONY
//=> Faridabad HARYANA 121001
//=> India

silverwind, distributed under BSD licence