note: i am not looking for workaround, i am looking for a plain ruby solution!
this question is the similar to this question, but it isn't answerd, its just a workaround to a shell commando there.
i want to generate a sha512 encrypted string which is compatible with the format in debian /etc/shadow.
the following create a correct string with php:
$salt = 'fGn9LR75';
$hash = crypt('test', '$6$'.$salt);
// hash is:
// $6$fGn9LR75$YpI/vJHjEhvrYp5/eUSRinpiXdMthCxFWSEo0ktFNUaRBsA7pCWYzzmQptmnfyHno9YEJFNHYuESj3nAQmSzc1
as far as i know this a normal, salted base64 encoded string. the spec of the sha generation method is here