From: Ruby Facet Date: 2008-08-03T18:27:51+09:00 Subject: Re: alphanumeric encrypt/decrypt Todd, thank you. I think that will work for me. Just to note that we can't remove one '=' in encrypt and add one in decrypt, the number of '=' could vary. > s = '1231243234232'; > [s].pack('m') => "MTIzMTI0MzIzNDIzMg==\n" Todd Benson wrote: > On Sun, Aug 3, 2008 at 12:19 AM, Ruby Facet wrote: >> Hello, >> >> Is there an encryption (decryption) routine that will return only >> alphanumeric characters? Looking forward to your help. >> >> RF > > s = 'aoa3(;12)>,$!' > [s].pack('m').chomp > > => "YW9hMyg71mwyKT4sJC=" > > I haven't read the RFC for base64, but it looks like you would then > need to allow the '=' symbol along with letters and numbers, but no > other special characters besides that. Perhaps '=' is a padding > character. > > cheers, > Todd -- Posted via http://www.ruby-forum.com/.