in reply to Re: Non-Formula based Text Encoding - with Compression
in thread Non-Formula based Text Encoding - with Compression
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Non-Formula based Text Encoding - with Compression
by jeffa (Bishop) on Apr 16, 2015 at 18:25 UTC | |
"You all need to read the comments ..." To be fair, you really could have made the "instructions" more clear, but i did take your suggestion and re-read your comments and came up with the following code: And yes, this is kind of cool. Why you didn't provide an end-to-end complete example is probably the root of your down-votes on the OP. "It is obvious to any Perl developer worth his salt what the code is doing and what the purpose is." Just remember, the more time you spend ensuring that your documentation is unambiguous, clear and complete the less time you'll spend defending your position, which essentially boils down to an inability to communicate effectively. Next time ... take the time to make your presentation more presentable -- in other words, implement the purpose as well. jeffa L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat) | [reply] [d/l] |
by Aldebaran (Curate) on Apr 22, 2015 at 06:32 UTC | |
I've been trying to figure this out since jeffa posted this, as I find the topic interesting. I couldn't see how this accomplished its compression, but it seemed to work with a very long word. I had to puzzle over it quite a bit and add print statements to figure out how it worked.
One sees that the first random values in the code array become the keys of the encode hash. I was hoping to actually accomplish some of the functionality that OP had hinted at, so I created some apparatus for saving to file as well:
I see this at a dead-end now, and the compression I thought I was seeing was actually just that the randomly-generated keys were smaller than the values of a hash. It was fun to play with, and I thank jeffa for writing it. I finally figured out how to display the program description:
Q1) What are good perl tools for crytography of one's sensitive data? | [reply] [d/l] [select] |
|
Re^3: Non-Formula based Text Encoding - with Compression
by Your Mother (Archbishop) on Apr 16, 2015 at 16:54 UTC | |
You all are just showing everyone you really don't understand Perl that well.split / */ Cough… cough… For my part, I liked jeffa’s version. Comments are always better as Pod. I’m not quite sure what “non-formula” means in this context. Is it a technical term related to encryption (not my forte)? | [reply] [d/l] |
by GotToBTru (Prior) on Apr 16, 2015 at 18:43 UTC | |
My guess is this is "non-formula" in that there is a lookup instead of evaluating a function that uses the plaintext contents. Excessively simple example of Caesar cipher:
| [reply] [d/l] |
by Aldebaran (Curate) on Apr 20, 2015 at 07:15 UTC | |
How do you get the comments to display when they are in POD format? | [reply] |
by Anonymous Monk on Apr 20, 2015 at 09:29 UTC | |
What? perlpod/perlpodspec/Tutorials -> Documenting Code -> POD in 5 minutes Boilerplate I just typed up Read more... (555 Bytes)
or boilerplate via old module_new Read more... (1211 Bytes)
boilerplate via module-starter --mi --module=TIS --author=name --email=email Read more... (4 kB) | [reply] [d/l] [select] |
|
Re^3: Non-Formula based Text Encoding - with Compression
by GotToBTru (Prior) on Apr 16, 2015 at 17:31 UTC | |
"The text document can be rewritten in encoded/compressed fashion this way, by mapping words to codes, then decoded at a later time using a persistent Perl SDBM database tied hash table holding the word-to-code mappings for a particular text document." It's a hash of word to code mappings, right? $hash{$word} = $codeYou put in one key, you get one value. One to one. You suggest there are many ways to accomplish this mapping, and perhaps you are thinking of using more than one of your codes to correspond to one word: $hash{$code1} = $word; $hash{$code2} = $word;This means encoding will require scanning the entire hash value list and then picking at random one of the possible code keys. It would work, of course; it just looks IMHO kind of clunky. You could make it as difficult to break as you needed, but in the end it would always be breakable. Since you already have in place a secure method for exchanging your database files, why not exchange random pads instead? | [reply] [d/l] [select] |