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

Error: Content was invalid #30

Open
n1c01a5 opened this issue Oct 11, 2022 · 1 comment
Open

Error: Content was invalid #30

n1c01a5 opened this issue Oct 11, 2022 · 1 comment

Comments

@n1c01a5
Copy link

n1c01a5 commented Oct 11, 2022

If I put a file as param I got this error: Error: Content was invalid.

The code: await Hash.of(file)

How can we compute the hash of a file ?

@VadimSaveljev
Copy link

Had same issue, managed to fix it by sending Uint8Array of my file's buffer

      const arrayBuffer = await fetch(url).then(response => response.arrayBuffer());
      const cid = await Hash.of(new Uint8Array(arrayBuffer));

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

2 participants