Created
October 15, 2017 16:09
-
-
Save joshuashaffer/9facdbf5445f7492afc6b0f13ba71c0b to your computer and use it in GitHub Desktop.
Recover Steganography Code embedded in RGB Values. e is the bit position.
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
| auto steganographer(vector<vector<long long>> r, int e) { | |
| bool f[r.size() * r[0].size()],*t; | |
| int z = 0; | |
| for (i:r) | |
| for (j:i) | |
| for(l:{3,2,1,0}) | |
| if (e&(1<<l)) f[z++] = j >> 8*l & 1; | |
| string s; | |
| for (t = f; t < f + z; t += 7) | |
| s += accumulate(t, t + 7, 0, [](int x, int y) { return (x << 1) + y; }); | |
| return s; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment