FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cryptography/src/cryptography/hashes/crc/CRC.java at master · norkator/cryptography · GitHub
norkator
/
cryptography
Public
Notifications
You must be signed in to change notification settings
Fork
44
Star
222
Code
Issues
2
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
cryptography
/
src
/
cryptography
/
hashes
/
crc
/
CRC.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (35 loc) · 1.04 KB
Breadcrumbs
cryptography
/
src
/
cryptography
/
hashes
/
crc
/
CRC.java
Copy path
File metadata and controls
45 lines (35 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
cryptography
.
hashes
.
crc
;
import
java
.
security
.
NoSuchAlgorithmException
;
import
jonelo
.
jacksum
.
JacksumAPI
;
import
jonelo
.
jacksum
.
algorithm
.
AbstractChecksum
;
public
class
CRC
{
public
static
void
main
(
String
[]
args
) {
}
private
static
String
jacksumAPI
(
String
input
,
String
instance
) {
String
output
=
""
;
AbstractChecksum
abstractChecksum
=
null
;
try
{
abstractChecksum
=
JacksumAPI
.
getChecksumInstance
(
instance
.
toLowerCase
());
abstractChecksum
.
update
(
input
.
getBytes
());
output
=
abstractChecksum
.
getFormattedValue
();
}
catch
(
NoSuchAlgorithmException
e
) {
e
.
printStackTrace
();
}
return
output
;
}
public
static
String
crc8
(
String
input
) {
return
jacksumAPI
(
input
,
"CRC-8"
);
}
public
static
String
crc16
(
String
input
) {
return
jacksumAPI
(
input
,
"CRC-16"
);
}
public
static
String
crc24
(
String
input
) {
return
jacksumAPI
(
input
,
"CRC-24"
);
}
public
static
String
crc32
(
String
input
) {
return
jacksumAPI
(
input
,
"CRC-32"
);
}
public
static
String
crc64
(
String
input
) {
return
jacksumAPI
(
input
,
"CRC-64"
);
}
}
Back
|
FazBrowse Home
|
New Git URL