final class HpackUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
HpackUtil.IndexType |
Modifier and Type | Field and Description |
---|---|
(package private) static byte[] |
HUFFMAN_CODE_LENGTHS |
(package private) static int[] |
HUFFMAN_CODES |
(package private) static int |
HUFFMAN_EOS |
Modifier | Constructor and Description |
---|---|
private |
HpackUtil() |
Modifier and Type | Method and Description |
---|---|
(package private) static int |
equalsConstantTime(java.lang.CharSequence s1,
java.lang.CharSequence s2)
Compare two
CharSequence objects without leaking timing information. |
static final int[] HUFFMAN_CODES
static final byte[] HUFFMAN_CODE_LENGTHS
static final int HUFFMAN_EOS
static int equalsConstantTime(java.lang.CharSequence s1, java.lang.CharSequence s2)
CharSequence
objects without leaking timing information.
The int
return type is intentional and is designed to allow cascading of constant time operations:
String s1 = "foo"; String s2 = "foo"; String s3 = "foo"; String s4 = "goo"; boolean equals = (equalsConstantTime(s1, s2) & equalsConstantTime(s3, s4)) != 0;
s1
- the first value.s2
- the second value.0
if not equal. 1
if equal.