Giter VIP home page Giter VIP logo

Comments (4)

fubuloubu avatar fubuloubu commented on May 30, 2024

I started looking at this, age::keys::Identity::from_buffer() requires std::io::BufRead. Can we get that from web_sys::File?

from wage.

str4d avatar str4d commented on May 30, 2024

File.stream() returns ReadableStream, which we can wrap with StreamReader to get something implementing AsyncRead (as with the file being decrypted), but not the blocking BufRead. I think what we eventually want is an equivalent Identity::from_async_buffer in age, but we could also manually read each identity into a secrecy::SecretVec and then pass those through Identity::from_buffer.

from wage.

pirate avatar pirate commented on May 30, 2024

Not sure if this issue is the right place for it, but if you need a snippet for this TODO in the readme Expose a Rust stream to JavaScript as a user-downloadable file., this one works well:

function download(content, filename, contentType) {
    contentType = contentType || 'application/octet-stream'
    const anchor = document.createElement('a')
    const blob = new Blob([content], {'type': contentType})
    anchor.href = window.URL.createObjectURL(blob)
    anchor.download = filename
    anchor.click()
}

from wage.

str4d avatar str4d commented on May 30, 2024

Implemented in #25.

from wage.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.