Last active
August 24, 2019 16:23
-
-
Save vasco-santos/748c49fe07a2b1d2fa85f25a093501bf to your computer and use it in GitHub Desktop.
Adapter for noise [https://github.com/ethberlinzwei/Bounties/issues/17]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const promiseToCallback = require('promise-to-callback') | |
const toPull = require('async-iterator-to-pull-stream') | |
const encrypt = async (localId, conn, remoteId) => { | |
// TODO implementation | |
// ... | |
pull( | |
conn, | |
toPull.duplex(handshake(state, finish)), | |
conn | |
) | |
// ... | |
} | |
module.exports = { | |
tag: '...', | |
encrypt (localId, conn, remoteId, callback) { | |
promiseToCallback(encrypt(localId, conn, remoteId))(callback) | |
}, | |
encryptAsync: encrypt | |
} |
Author
vasco-santos
commented
Aug 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment