8000 kernel: utilities: add simple hash function (re: app checker and AppID) by bradjc · Pull Request #3808 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kernel: utilities: add simple hash function (re: app checker and AppID) #3808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

bradjc
Copy link
Contributor
@bradjc bradjc commented Jan 19, 2024

Pull Request Overview

The AppID TRD references being able to assign ShortIDs to applications (and therefore running processes) based on the app name. To do this, we need a function with signature fn create_short_id(s: &'static str) -> u32.

I just made this one up since it is simple to implement, doesn't require a dependency, and will probably work for the type of basic use cases that we want to be able to experiment with. For example, I've used this to assign specific applications by name to specific regions on a screen. We could also assign apps to LEDs or any other resource. What is nice is this "just works" without having to add new TBF headers, and we as humans have an easy time understanding the app name.

Testing Strategy

Work on screens.

TODO or Help Wanted

If there is something in the core library that would be better.

If there is a more well known simple hash-like function that does this that might be better. I'm opening this PR because I think we need something like this, but I'm not exactly sure what.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@lschuermann
Copy link
Member

I don't like that we're inventing our own "hash" algorithm here, but I do see the elegance in supporting one with so little complexity. I think this is fine, but is there really no established (CRC / CRC-like) algorithm we could use instead?

@bradjc bradjc closed this Feb 1, 2024
@alistair23 alistair23 deleted the addhash branch February 2, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0