Skip to content

Common byte operations on arrays and slices

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

nvzqz/byte-ops-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Byte Ops

Common byte operations on arrays and slices in Rust.

Supported Operations

The Bytes trait contains all operations for this crate. As of this writing, they are:

  • is: indicates whether every byte in a value equals a certain byte.

  • contains: indicates whether any byte in a value equals a certain byte.

  • {first,last}_{eq,ne}{,_mut}: returns a [mutable] reference to the first/last byte that is [not] equal to a certain byte.

SIMD

This crate contains SIMD-accelerated implementations, which can be enabled via the simd feature. This enables parallel operations on values with 128 bits (or more).

[dependencies.byte-ops]
version  = "0.1.0"
features = ["simd"]

Nightly only: as of this writing, this is only available on Rust nightly.

AVX

When targeting x86, some extra performance can be gained by enabling advanced vector extensions. This allows for parallel operations on 256 bits. Note that this comes with a compatibility tradeoff. See CPUs with AVX.

To enable AVX, set the following compilation environment variable:

RUSTFLAGS="-C target-feature +avx"

License

This library is licensed under either of

at your option.

About

Common byte operations on arrays and slices

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages