Posted to tcl by rhobart at Wed Aug 27 21:03:14 GMT 2025view raw

  1. proc paddata {data} {
  2. global block_size
  3. set len_data [string length $data]
  4. puts "Pad needed: [expr ($block_size - $len_data) % $block_size]"
  5. set padding [string repeat "\000" [expr (($block_size - $len_data) % $block_size)]]
  6. puts "Padding: $padding PaddingLen:[string length $padding]"
  7. #binary scan [encoding convertto ascii $padding] c* bin_padding
  8. #puts "Binary padding: [string length $bin_padding]"
  9. append data $padding
  10. puts "New len: [string length $data]"
  11. return $data
  12. }
  13.  

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week