Skip to content

Instantly share code, notes, and snippets.

@AljoschaMeyer
Created June 9, 2017 14:26
Show Gist options
  • Save AljoschaMeyer/3ee175593a536b6832d0b2d59790c79e to your computer and use it in GitHub Desktop.
Save AljoschaMeyer/3ee175593a536b6832d0b2d59790c79e to your computer and use it in GitHub Desktop.
Generate minimal test data for box-stream
const sodium = require('chloride');
const boxes = require('pull-box-stream');
const pull = require('pull-stream');
const encryptionKey = Buffer.from([162,29,153,150,123,225,10,173,175,201,160,34,190,179,158,14,176,105,232,238,97,66,133,194,250,148,199,7,34,157,174,24, 44,140,79,227,23,153,202,203,81,40,114,59,56,167,63,166,201,9,50,152,0,255,226,147]);
const plain1 = Buffer.from([0, 1, 2, 3, 4, 5, 6, 7]);
const plain2 = Buffer.from([7, 6, 5, 4, 3, 2, 1, 0]);
pull(
pull.values([plain1, plain2]),
boxes.createBoxStream(encryptionKey),
pull.collect((err, arg) => console.log(JSON.stringify(arg)))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment