newlisp 使用crypto模块
在Ubuntu12.04/12.10 amd64下安装需要的库:
[cpp]
apt-get install libssl0.9.8
之后创建一个链接:
[plain] www.zzzyk.com
ln -s /lib/x86_64-linux-gnu/libcrypto.so.0.9.8 /usr/lib/
现在启动newlisp交互环境,试一下:
[plain]
(load "crypto.lsp")
(lambda (crypto:str crypto:raw-flag)
(if crypto:raw-flag
(let (crypto:buff (dup "\000" 20))
(cpymem (crypto:RIPEMD160 crypto:str (length crypto:str) 0) crypto:buff 20) crypto:buff)
(join (map (lambda (crypto:x) (format "%02x" (& crypto:x 255))) (unpack (dup "c"
20)
(crypto:RIPEMD160 crypto:str (length crypto:str) 0))))))
> (crypto:md5 "ABC")
"902fbdd2b1df0c4f70b4a5d23525e932"
补充:软件开发 , C++ ,