Digest¶
| Spice | |
|---|---|
Functions¶
rotateLeft32¶
| Spice | |
|---|---|
Rotate a 32 bit word to the left.
The rotation count has to be in the range 1..31. Rotating by 0 or 32 would shift a word by its full width, which is undefined behavior.
Parameters
| Name | Type | Description |
|---|---|---|
value |
unsigned int |
Word to rotate |
count |
int |
Number of bits to rotate by (1..31) |
Returns: unsigned int — Rotated word
rotateRight32¶
| Spice | |
|---|---|
Rotate a 32 bit word to the right.
The rotation count has to be in the range 1..31. Rotating by 0 or 32 would shift a word by its full width, which is undefined behavior.
Parameters
| Name | Type | Description |
|---|---|---|
value |
unsigned int |
Word to rotate |
count |
int |
Number of bits to rotate by (1..31) |
Returns: unsigned int — Rotated word
rotateLeft64¶
| Spice | |
|---|---|
Rotate a 64 bit word to the left.
The rotation count has to be in the range 1..63. Rotating by 0 or 64 would shift a word by its full width, which is undefined behavior.
Parameters
| Name | Type | Description |
|---|---|---|
value |
unsigned long |
Word to rotate |
count |
int |
Number of bits to rotate by (1..63) |
Returns: unsigned long — Rotated word
rotateRight64¶
| Spice | |
|---|---|
Rotate a 64 bit word to the right.
The rotation count has to be in the range 1..63. Rotating by 0 or 64 would shift a word by its full width, which is undefined behavior.
Parameters
| Name | Type | Description |
|---|---|---|
value |
unsigned long |
Word to rotate |
count |
int |
Number of bits to rotate by (1..63) |
Returns: unsigned long — Rotated word
toHexString¶
| Spice | |
|---|---|
Render a raw digest as its lowercase hexadecimal representation, two chars per byte.
Parameters
| Name | Type | Description |
|---|---|---|
digest |
const byte[] |
Digest bytes to render |
length |
unsigned long |
Number of digest bytes |
Returns: String — Hex representation of the digest