Hanaasagi / machine-uid

Get machine id without root permission
https://crates.io/crates/machine-uid
MIT License
25 stars 12 forks source link

🌶️ Remove built in C dependency #13

Closed Jasper-Bekkers closed 2 months ago

Jasper-Bekkers commented 2 months ago

It's not really needed to bring in bindgen and other large crates for this as we can just move the code into Rust instead to make this crate a bit leaner.

Hanaasagi commented 2 months ago

I saw that this piece of cpp code was introduced in https://github.com/Hanaasagi/machine-uid/pull/4 to fix x86 compatibility. Would there be any impact if it were removed?

Jasper-Bekkers commented 2 months ago

I wouldn't expect it to, what is causing the x86 compat is the function call. We need to manually load the dll and query the entrypoint because it doesnt always exist.

All of this can just easily be done from Rust just as well - which this PR does.

Put another way, the actual code thats executed doesn't change with this PR, however, it's written in Rust now.

Hanaasagi commented 2 months ago

Thank you.