-
Notifications
You must be signed in to change notification settings - Fork 4
/
nmea0183_checksum_calculator.html
69 lines (58 loc) · 1.99 KB
/
nmea0183_checksum_calculator.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<head>
<title>NMEA0183 Checksum calculator</title>
<link href="style.css" rel="stylesheet" type="text/css">
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(28716631, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/28716631" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<script type="text/javascript">
function NMEA0183_getChecksum(sentence) {
var result = 0;
for( var idx = 0; idx < sentence.length; idx++) {
result = result ^ sentence.charCodeAt(idx);
}
return result;
}
function nmeaSnt_onKey() {
el = document.getElementById("snt_input");
el.style.width = ((el.value.length + 3) * 8);
chk_sum = NMEA0183_getChecksum(el.value);
document.getElementById("chk_sum").innerText = Number(chk_sum).toString(16).padStart(2, "0").toUpperCase();
}
</script>
</head>
<body>
<h1>NMEA0183 Checksum calculator</h1>
<hr>
<p>
<tt>
<big>
<b>$</b><input id="snt_input" type="text" maxlength="128" oninput="nmeaSnt_onKey()" value="GNGLL,4443.1365,N,03749.8815,E,071803.000,A,A"><b>*<a id="chk_sum"></a></b>
</big>
</tt>
</p>
<br>
<i>
<b>Brief description:</b> NMEA0183 checksum is just a simple byte-by-byte XOR of
all the bytes between <b>$</b> and <b>*</b> signs exclusively.
</i>
<hr>
<a href="https://docs.unavlab.com/online_utilities_en.html">Back to Online Utilities page</a>
<hr>
(C) Alek Dikarev, 2020<br>
For bug reports, suggestions and questions, please feel free to <a href="https://github.com/AlekUnderwater">reach me</a><br>
<script type="text/javascript">
nmeaSnt_onKey();
</script>
</body>
</html>