Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 .NET 客户端,它将一些数字作为 32 位整数存储在 memcached 中。
我不能在 Ruby 客户端中使用这些数字,也不能存储可以在 .NET 中使用的数字。
检查Array#pack和String#unpack方法:
Array#pack
String#unpack
> [42].pack('l') # => "*\x00\x00\x00"
也许这可以帮助你
http://bindata.rubyforge.org/
您可以按照您想要的方式存储所需的数据。