Package org.zkoss.util
Class Checksums
- java.lang.Object
-
- org.zkoss.util.Checksums
-
public class Checksums extends java.lang.ObjectChecksum relevant utilities.- Author:
- tomyeh
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSKIPSThe default skips.
-
Constructor Summary
Constructors Constructor Description Checksums()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static chargetChecksum(java.lang.StringBuffer val, java.lang.String skips)Returns the checksum character of the specified val.static chargetChecksum(java.lang.String val, java.lang.String skips)Returns the checksum character of the specified val.static java.lang.StringtoReadable(long val, java.lang.String skips)Returns a readable string plus a checksum.static chartoReadableChar(int val, java.lang.String skips)Returns the character of the specified val by skipping skips.
-
-
-
Field Detail
-
SKIPS
public static final java.lang.String SKIPS
The default skips.- See Also:
- Constant Field Values
-
-
Method Detail
-
toReadable
public static final java.lang.String toReadable(long val, java.lang.String skips)Returns a readable string plus a checksum.- Parameters:
skips- specifies a string of characters that shall be skipped. If null specified, "DEOX" is assumed. To skip nothing, specify "". You can only specify upper-case letters: A-Z. And, it must be in alphabetic order.
-
toReadableChar
public static final char toReadableChar(int val, java.lang.String skips)Returns the character of the specified val by skipping skips. Note: the caller must ensure val is in the right range: 0 - (36 - skips.length()).- Parameters:
skips- specifies a string of characters that shall be skipped. If null specified, "DEOX" is assumed. To skip nothing, specify "". You can only specify upper-case letters: A-Z. And, it must be in alphabetic order.
-
getChecksum
public static final char getChecksum(java.lang.String val, java.lang.String skips)Returns the checksum character of the specified val.It use
toReadableChar(int, java.lang.String)to convert the checksum to a character.Note: it skips '-' and ' '.
- Parameters:
skips- specifies a string of characters that shall be skipped. If null specified, "DEOX" is assumed. To skip nothing, specify "". You can only specify upper-case letters: A-Z. And, it must be in alphabetic order.
-
getChecksum
public static final char getChecksum(java.lang.StringBuffer val, java.lang.String skips)Returns the checksum character of the specified val.It use
toReadableChar(int, java.lang.String)to convert the checksum to a character.Note: it skips '-' and ' '.
- Parameters:
skips- specifies a string of characters that shall be skipped. If null specified, "DEOX" is assumed. To skip nothing, specify "". You can only specify upper-case letters: A-Z. And, it must be in alphabetic order.
-
-