S
S
Sergey Gorlanov2014-05-08 13:04:47
ruby
Sergey Gorlanov, 2014-05-08 13:04:47

How to get the correct md5 from a Cyrillic string in a different encoding?

Ruby
comes with a Cyrillic string.
this value is used to calculate check sum Calculate on the client
in win1251 On the
server in utf-8 => 584b8d4f423c8ff41e226ea5b979fbbe #utf8 DIgest::MD5.hexdigest("f".encode("cp1251")) #=> 97a6dd4c45b23db9c5d603ce161b8cab By the way "f".encode("cp1251") #=>\xF4

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question