⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains hidden or 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
//PNG steganography utils | |
//ratio: about 2 pixels per 1 byte of text message | |
//Auto EOD byte as 255 | |
//Use only non-transparent images as the algo has to modify alpha-channel of affected pixels | |
//to protect RGB values from in-browser rounding | |
+function(w) { | |
var bitMapping = [0, 1, 2, 4, 5, 6, 8, 9], img = new Image(), cnv = document.createElement('canvas'), ctx=cnv.getContext('2d') | |
w.Stego = { | |
hide: function(imglink, msg, cb) { //image data URI (not only PNG) and message as input, resulting PNG image data URI as output (to callback) |