Posted to tcl by rhobart at Wed Aug 27 21:03:14 GMT 2025view raw
- proc paddata {data} {
- global block_size
- set len_data [string length $data]
- puts "Pad needed: [expr ($block_size - $len_data) % $block_size]"
- set padding [string repeat "\000" [expr (($block_size - $len_data) % $block_size)]]
- puts "Padding: $padding PaddingLen:[string length $padding]"
- #binary scan [encoding convertto ascii $padding] c* bin_padding
- #puts "Binary padding: [string length $bin_padding]"
- append data $padding
- puts "New len: [string length $data]"
- return $data
- }
Add a comment