Header menu logo TDesu.FSharp

Bytes Module

Functions and values

Function or value Description

Bytes.concat2 a b

Full Usage: Bytes.concat2 a b

Parameters:
    a : 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.

a : byte[]
b : byte[]
Returns: byte[]

Bytes.concat3 a b c

Full Usage: Bytes.concat3 a b c

Parameters:
    a : 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.

a : byte[]
b : byte[]
c : byte[]
Returns: 'a array

Bytes.concat4 a b c d

Full Usage: Bytes.concat4 a b c d

Parameters:
    a : 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.

a : byte[]
b : byte[]
c : byte[]
d : byte[]
Returns: 'a array

Bytes.constantTimeEquals a b

Full Usage: Bytes.constantTimeEquals a b

Parameters:
    a : 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.

a : byte[]
b : byte[]
Returns: bool

Bytes.copyTo src srcOff dst dstOff len

Full Usage: Bytes.copyTo src srcOff dst dstOff len

Parameters:
    src : 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.

src : byte[]
srcOff : int
dst : byte[]
dstOff : int
len : int

Bytes.fill value offset length arr

Full Usage: Bytes.fill value offset length arr

Parameters:
    value : 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.

value : byte
offset : int
length : int
arr : byte[]

Bytes.regionEquals a aOff b bOff len

Full Usage: Bytes.regionEquals a aOff b bOff len

Parameters:
    a : 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.

a : byte[]
aOff : int
b : byte[]
bOff : int
len : int
Returns: bool

Bytes.slice source offset length

Full Usage: Bytes.slice source offset length

Parameters:
    source : 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.

source : byte[]
offset : int
length : int
Returns: 'a array

Bytes.xor a b

Full Usage: Bytes.xor a b

Parameters:
    a : byte[]
    b : byte[]

Returns: byte array

XORs two byte arrays element-wise, returning a new array. The first byte array. The second byte array.

a : byte[]
b : byte[]
Returns: byte array

Bytes.xorBlock a aOff b bOff dst dstOff len

Full Usage: Bytes.xorBlock a aOff b bOff dst dstOff len

Parameters:
    a : 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.

a : byte[]
aOff : int
b : byte[]
bOff : int
dst : byte[]
dstOff : int
len : int

Bytes.xorInPlace a aOff b bOff len

Full Usage: Bytes.xorInPlace a aOff b bOff len

Parameters:
    a : 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.

a : byte[]
aOff : int
b : byte[]
bOff : int
len : int

Type something to start searching.