Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Binding the libc 'crypt' function using FFI.

View ffi_crypt.rb
1 2 3 4 5 6 7 8 9 10
require 'ffi'
 
module Crypt
extend FFI::Library
ffi_lib 'c'
 
attach_function :crypt, [:string, :string], :string
end
 
p Crypt.crypt 'this is a string', 'this is the salt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.