{"action":"created","issue":{"url":"https://api.github.com/repos/shepmaster/jetscii/issues/13","repository_url":"https://api.github.com/repos/shepmaster/jetscii","labels_url":"https://api.github.com/repos/shepmaster/jetscii/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/shepmaster/jetscii/issues/13/comments","events_url":"https://api.github.com/repos/shepmaster/jetscii/issues/13/events","html_url":"https://github.com/shepmaster/jetscii/issues/13","id":133723766,"number":13,"title":"expose more primitive operations","user":{"login":"BurntSushi","id":456674,"avatar_url":"https://avatars.githubusercontent.com/u/456674?v=3","gravatar_id":"","url":"https://api.github.com/users/BurntSushi","html_url":"https://github.com/BurntSushi","followers_url":"https://api.github.com/users/BurntSushi/followers","following_url":"https://api.github.com/users/BurntSushi/following{/other_user}","gists_url":"https://api.github.com/users/BurntSushi/gists{/gist_id}","starred_url":"https://api.github.com/users/BurntSushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BurntSushi/subscriptions","organizations_url":"https://api.github.com/users/BurntSushi/orgs","repos_url":"https://api.github.com/users/BurntSushi/repos","events_url":"https://api.github.com/users/BurntSushi/events{/privacy}","received_events_url":"https://api.github.com/users/BurntSushi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-02-15T14:18:17Z","updated_at":"2016-02-17T15:23:14Z","closed_at":null,"body":"As I understand it, the public API currently requires that haystacks be `&str` and that all needles be ASCII. Might you consider exposing a way to run a search on a `&[u8]`? And possibly also exposing a way to use arbitrary bytes instead of limiting it to ASCII? (I feel less strongly about the latter point than the former point.)\r\n\r\nThe specific reason why I'd want this is for use in `regex`. In particular, the internal matching engines can work on either `&str` or `&[u8]`, so the prefix literal scanning operates on `&[u8]` so that it can be used with any of the matching engines. Since all inputs originate with `&str` (currently), I could unsafely transmute to `&[u8]` before calling out to jetscii, but I don't think that assumption will always hold in the future and the use of unsafe there seems a little unfortunate.\r\n\r\nOther ideas? Thoughts?"},"comment":{"url":"https://api.github.com/repos/shepmaster/jetscii/issues/comments/185252324","html_url":"https://github.com/shepmaster/jetscii/issues/13#issuecomment-185252324","issue_url":"https://api.github.com/repos/shepmaster/jetscii/issues/13","id":185252324,"user":{"login":"BurntSushi","id":456674,"avatar_url":"https://avatars.githubusercontent.com/u/456674?v=3","gravatar_id":"","url":"https://api.github.com/users/BurntSushi","html_url":"https://github.com/BurntSushi","followers_url":"https://api.github.com/users/BurntSushi/followers","following_url":"https://api.github.com/users/BurntSushi/following{/other_user}","gists_url":"https://api.github.com/users/BurntSushi/gists{/gist_id}","starred_url":"https://api.github.com/users/BurntSushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BurntSushi/subscriptions","organizations_url":"https://api.github.com/users/BurntSushi/orgs","repos_url":"https://api.github.com/users/BurntSushi/repos","events_url":"https://api.github.com/users/BurntSushi/events{/privacy}","received_events_url":"https://api.github.com/users/BurntSushi/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T15:23:13Z","updated_at":"2016-02-17T15:23:13Z","body":"> What would you actually be using for your fallback? \r\n\r\nYes, absolutely. :-)\r\n\r\nThe `memchr` functions are here: http://burntsushi.net/rustdoc/memchr/ Note the existence of `memchr2` and `memchr3`, which I cobbled together specifically in cases where something like jetscii can't be used. They should be faster than the naive `|b| b == b'A' || b == b'Z'`.\r\n\r\n@huonw - I wonder if you might have any special knowledge in this space, since I know you've been working on simd stuff. (I've looked at it, but can't quite grok how to use it for substring/byte matching!)"}}