Bytes Module
Functions and values
| Function or value |
Description
|
Full Usage:
Bytes.concat2 a b
Parameters:
byte[]
b : byte[]
Returns: byte[]
|
Concatenates two byte arrays using BlockCopy (faster than Array.append for bytes). The first byte array. The second byte array.
|
Full Usage:
Bytes.concat3 a b c
Parameters:
byte[]
b : byte[]
c : byte[]
Returns: 'a array
|
Concatenates three byte arrays without intermediate allocations. The first byte array. The second byte array. The third byte array.
|
Full Usage:
Bytes.concat4 a b c d
Parameters:
byte[]
b : byte[]
c : byte[]
d : byte[]
Returns: 'a array
|
Concatenates four byte arrays without intermediate allocations. The first byte array. The second byte array. The third byte array. The fourth byte array.
|
Full Usage:
Bytes.constantTimeEquals a b
Parameters:
byte[]
b : byte[]
Returns: bool
|
Constant-time byte array comparison (timing-safe for crypto). Both arrays must be the same length; returns false immediately if lengths differ. Safe for HMAC verification where output lengths are fixed and known. The first byte array. The second byte array.
|
Full Usage:
Bytes.copyTo src srcOff dst dstOff len
Parameters:
byte[]
srcOff : int
dst : byte[]
dstOff : int
len : int
Modifiers: inline |
Copies source bytes into destination at the given offset. The source byte array. The offset into the source array. The destination byte array. The offset into the destination array. The number of bytes to copy.
|
Full Usage:
Bytes.fill value offset length arr
Parameters:
byte
offset : int
length : int
arr : byte[]
Modifiers: inline |
Fills a byte array region with a constant value. The byte value to fill with. The starting offset in the array. The number of bytes to fill. The target byte array.
|
Full Usage:
Bytes.regionEquals a aOff b bOff len
Parameters:
byte[]
aOff : int
b : byte[]
bOff : int
len : int
Returns: bool
|
Returns true if two byte array regions are equal. The first byte array. The offset into the first array. The second byte array. The offset into the second array. The number of bytes to compare.
|
Full Usage:
Bytes.slice source offset length
Parameters:
byte[]
offset : int
length : int
Returns: 'a array
|
Copies a slice of a byte array using BlockCopy. The source byte array to slice from. The starting offset in the source array. The number of bytes to copy.
|
Full Usage:
Bytes.xor a b
Parameters:
byte[]
b : byte[]
Returns: byte array
|
XORs two byte arrays element-wise, returning a new array. The first byte array. The second byte array.
|
Full Usage:
Bytes.xorBlock a aOff b bOff dst dstOff len
Parameters:
byte[]
aOff : int
b : byte[]
bOff : int
dst : byte[]
dstOff : int
len : int
Modifiers: inline |
XORs two byte arrays at given offsets into a destination array. The first source byte array. The offset into the first source array. The second source byte array. The offset into the second source array. The destination byte array. The offset into the destination array. The number of bytes to XOR.
|
Full Usage:
Bytes.xorInPlace a aOff b bOff len
Parameters:
byte[]
aOff : int
b : byte[]
bOff : int
len : int
|
XORs b into a in-place (mutates a). The target byte array to mutate. The offset into the target array. The source byte array to XOR from. The offset into the source array. The number of bytes to XOR.
|
TDesu.FSharp