Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alecmocatta/build_id
Obtain a UUID uniquely representing the build of the current binary.
https://github.com/alecmocatta/build_id
rust
Last synced: 12 days ago
JSON representation
Obtain a UUID uniquely representing the build of the current binary.
- Host: GitHub
- URL: https://github.com/alecmocatta/build_id
- Owner: alecmocatta
- License: apache-2.0
- Created: 2018-07-20T11:59:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-11T21:31:46.000Z (over 1 year ago)
- Last Synced: 2024-10-13T15:24:58.238Z (26 days ago)
- Topics: rust
- Language: Rust
- Homepage:
- Size: 53.7 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE.txt
Awesome Lists containing this project
- awesome-software-supply-chain-security - alecmocatta/build_id: Obtain a UUID uniquely representing the build of the current binary.
README
# build_id
[![Crates.io](https://img.shields.io/crates/v/build_id.svg?maxAge=86400)](https://crates.io/crates/build_id)
[![MIT / Apache 2.0 licensed](https://img.shields.io/crates/l/build_id.svg?maxAge=2592000)](#License)
[![Build Status](https://dev.azure.com/alecmocatta/build_id/_apis/build/status/tests?branchName=master)](https://dev.azure.com/alecmocatta/build_id/_build/latest?branchName=master)[Docs](https://docs.rs/build_id/0.2.1)
Obtain a [`Uuid`](https://docs.rs/uuid/0.8/uuid/) uniquely representing the
build of the current binary.This is intended to be used to check that different processes are indeed
invocations of identically laid out binaries.As such:
* It is guaranteed to be identical within multiple invocations of the same
binary.
* It is guaranteed to be different across binaries with different code or data
segments or layout.
* Equality is unspecified if the binaries have identical code and data segments
and layout but differ immaterially (e.g. if a timestamp is included in the
binary at compile time).## Examples
```rust
let local_build_id = build_id::get();
if local_build_id == remote_build_id {
println!("We're running the same binary as remote!");
} else {
println!("We're running a different binary to remote");
}
```## Note
This looks first for linker-inserted build ID / binary UUIDs (i.e.
`.note.gnu.build-id` on Linux; `LC_UUID` in Mach-O; etc), falling back to
hashing the whole binary.## License
Licensed under either of* Apache License, Version 2.0, ([LICENSE-APACHE.txt](LICENSE-APACHE.txt) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT.txt](LICENSE-MIT.txt) or http://opensource.org/licenses/MIT)at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.