pastebin
Add a new paste
View all pastes
Change language
Dutch
English
French
Russian
menu
URL Shortener
Multiple URL shortener
browser info
Whois IP and domain lookup
Capture a Website screenshot
Disqus Chatroom
Registration
pastebin
Paste Search Dynamic
Recent pastes
cnt
5 hours ago
warning infinitely in
5 hours ago
BHPSOGWO
5 hours ago
Arrays associate
5 hours ago
Schedule
5 hours ago
Arrays associate error
5 hours ago
test
5 hours ago
ArrayList
5 hours ago
mainloop
5 hours ago
ArrayHash
5 hours ago
byte data new byte
using
system
;
public
class
Test
{
public
static
void
Main
(
)
{
byte
[
]
data =
new
byte
[
]
{
0x10, 0x63, 0x00, 0x4A, 0x00
}
;
ushort
crc = 0xFFFF;
for
(
int
i =
0
; i < data.
Length
; i++
)
{
crc ^= data
[
i
]
;
for
(
int
j =
0
; j <
8
; j++
)
{
if
(
(
crc & 0x0001
)
== 0x0001
)
{
crc =
(
ushort
)
(
(
crc >>
1
)
^ 0xA001
)
;
}
else
{
crc >>=
1
;
}
}
}
string
crcString = crc.
ToString
(
"X4"
)
;
Console.
WriteLine
(
"CRC-16 IBM: "
+ crcString
)
;
}
}
Parsed in 0.010 seconds