Skip to content
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

bug: fix ni:// translator #42

Open
cboettig opened this issue Mar 27, 2020 · 0 comments
Open

bug: fix ni:// translator #42

cboettig opened this issue Mar 27, 2020 · 0 comments

Comments

@cboettig
Copy link
Owner

cboettig commented Mar 27, 2020

Translation from ni:// needs to support url-encoded base64 strings, with and without percent-encoding.
I'm not entirely sure how to translate those into hexadecimal. e.g. here's an ni:// identifier: ni:///sha256;N6yv_VPrTmQ4Mf6bFfay2XJxqYnr-d2i7QvAMGUsgQA

Here's the ni (base64url-encoded) hash vs the vanilla base64-encoded hash (e.g. as it would look in SRI or SSB):

N6yv_VPrTmQ4Mf6bFfay2XJxqYnr-d2i7QvAMGUsgQA
N6yv/VPrTmQ4Mf6bFfay2XJxqYnr+d2i7QvAMGUsgQA=

The / and + have been encoded as _ and - instead, and the trailing = dropped. I'm not sure how to reverse that as the thing isn't percent-encoded.

(Also I believe according to the spec, ni:///;N6yv%2fVPrTmQ4Mf6bFfay2XJxqYnr%2bd2i7QvAMGUsgQA is also valid (note the percent encoding this time) but even hash-archive.org fails to parse that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant