Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Degrees, minutes, seconds (sexagesimal) to decimal GPS positions. Useful for parsing PGS exif tags in geotagged images.
npm install dms2dec --save
var dms2dec = require('dms2dec');
<script language="JavaScript" src="/dms2dec.js"></script>
[latDec
, lonDec
] = dms2dec(String lat
, String latRef
, String lon
, String lonRef
);
lat
– latitude in "degrees, minutes, seconds" formatlagRef
– latitude hemisphere reference (N or S)lon
– longitude in "degrees, minutes, seconds" formatlonRef
– longitude hemisphere reference (E or W)latDec
– latitude converted into decimal formatlonDec
– longitude converted into decimal formatvar dec = dms2dec("60/1, 21/1, 4045/100", "N", "5/1, 22/1, 1555/100", "E");
// dec[0] == 60.36123611111111, dec[1] == 5.370986111111111
// without spaces or commas in the dms strings are also supported
var dec = dms2dec("60/1,21/1,4045/100", "N", "5/1,22/1,1555/100", "E");
var dec = dms2dec("60/1 21/1 4045/100", "N", "5/1 22/1 1555/100", "E");
var dec = dms2dec(["60/1", "21/1", "4045/100"], "N", ["5/1", "22/1", "1555/100"], "E");
// dec[0] == 60.36123611111111, dec[1] == 5.370986111111111
var dec = dms2dec([60, 21, 40.45], "N", [5, 22, 15.55], "E");
// dec[0] == 60.36123611111111, dec[1] == 5.370986111111111
NB!
Remember that GeoJSON stores coordinates in reversed order (longitude
,
latitude
) which means you have to reverse the order of the coordinates
returned from dms2dec()
.
var geojson = {
type: 'Point',
coordinates: dms2dec(lat, latRef, lon, lonRef).reverse()
};
FAQs
GPS degrees, minutes, seconds coordinates to decimal
The npm package dms2dec receives a total of 1,007 weekly downloads. As such, dms2dec popularity was classified as popular.
We found that dms2dec 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.