region_eq
fn region_eq(Vec<byte> a, int ao, Vec<byte> b, int bo, int n) -> bool Import
Source: use bytes::{region_eq}; src/bytes.hy True when a[ao..ao+n) equals b[bo..bo+n) (caller guarantees bounds).
Parameters#
| Name | Type |
|---|---|
a | Vec<byte> |
ao | int |
b | Vec<byte> |
bo | int |
n | int |
Returns#
bool
Contracts#
Checked according to --contracts (see Contracts).
requires ao >= 0 && bo >= 0 && n >= 0
requires ao + n <= a.len() && bo + n <= b.len()
See also#
to_hex: Encodesbufas lowercase hexadecimal, two digits per byte.from_hex: Decodes hexadecimal text (either case) into bytes.slice: Returns a copy ofsrc[start..end](end exclusive), with both offsets clamped to the buffer.concat: Returns a new buffer holdingafollowed byb.eq: Returnstruewhenaandbhave the same length and the same bytes.find_from: Returns the offset of the firstneedleinhayat or afterstart, or-1.find: Returns the offset of the firstneedleinhay, or-1.rfind: Returns the offset of the lastneedleinhay, or-1.