A much better commit of the raw rmagick access. Huge time improvement for calculating the salt.

This commit is contained in:
monqui 2026-07-20 19:16:30 -04:00
parent 0b26d83313
commit e10bedee0f
4 changed files with 51 additions and 93 deletions

View file

@ -1,13 +1,10 @@
require "rmagick"
require "./image_utils.rb"
require "./encode_image.rb"
img = Magick::ImageList.new "./images/original/arty.png"
#srand(12345)
pass = "my_password"
message = "This is the message that I would like to save please " +
"and thank you also I love you? AND apostrophe's, and " +
"also some commas somewhere hiding around here, It's " +
@ -24,17 +21,21 @@ message = "This is the message that I would like to save please " +
"are going even further. further than anyone believed " +
"`~!@\#\{$%^&*()-_=+\][}{';:'}]} Wooow. 123456789!1234" +
"56789! so put 15 more??????400!"
#message = "tests"
puts message.length
puts message
puts
puts "Initializing EncodeImage..."
start = Time.new.to_f
em = EncodeImage.new(pass, message, img)
puts "Initializing EncodeImage..."
iu = ImageUtils.new(pass, message, "./images/original/arty.png")
puts "Took " + (Time.new.to_f - start).to_s + " seconds to encode... 🐱"
=begin
em = EncodeImage.new(pass, message, "./images/original/arty.png")
puts em.encode
puts "Took " + (Time.new.to_f - start).to_s + " seconds to encode... 🐱"
@ -46,13 +47,12 @@ result = em.decode
puts result
=end
puts "Took " + (Time.new.to_f - start).to_s + " seconds to decode... 🐱"
if message == result then
puts "WOW THEY MATCH! 🐱🐱🐱🐱🐱🐱🐱🐱"
end
exit
puts
puts "Done!"