RunKit + npm: heatshrink-ts

node v9.11.2
version: 1.0.0
endpointsharetweet
var heatshrinkTs = require("heatshrink-ts"); const WINDOW_BITS = 8; const LOOKAHEAD_BITS = 4; const INPUT_BUFFER_LENGTH = 64; // Heatshrink Encoded form of the ASCII string 'this is a test' let encodedInput = new Uint8Array([0xba, 0x5a, 0x2d, 0x37, 0x39, 0x00, 0x08, 0xac, 0x32, 0x0b, 0xa5, 0x96, 0xe7, 0x74]); let decoder = new heatshrinkTs.HeatshrinkDecoder(WINDOW_BITS, LOOKAHEAD_BITS, INPUT_BUFFER_LENGTH); decoder.process(encodedInput); let output = decoder.getOutput(); // This will print 'Decoded output: this is a test' let outputString = String.fromCharCode(...output); console.log("Decoded output: " + outputString);
Created from: https://npm.runkit.com/heatshrink-ts
Loading…

no comments

    sign in to comment