This file contains 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
Red [file: %huffy.red] | |
;; message to encode: | |
msg: "this is an example for huffman encoding" | |
;;map to collect leave knots per uniq character of message | |
m: make map! [] | |
knot: make object! [ | |
left: right: none ;; pointer to left/right sibling |
This file contains 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
Red [needs: 'view] | |
CRLF: copy "^M^/" ;; constant for 0D 0A line feed | |
;;------------------------------------ | |
crypt: func ["function to en- or decrypt message from textarea tx1" | |
/decrypt "decrypting switch/refinement" ][ | |
;;------------------------------------ | |
;; when decrypting we have to remove the superflous newlines | |
;; and undo the base64 encoding first ... |
This file contains 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
Red[] | |
;; read win1252 textfile , convert to utf8 text string / lines with _myread %filename | |
;;#include %../inc/_utf8.red | |
_m: [] | |
insert/dup _m #{} 255 | |
;----------------------------------------- | |
_ini: function [/extern _m ][ | |
;----------------------------------------- | |
;; erzeugen ut8 map dec -> utf8 |