可以用openresty来生成随机的48位数么?

162 views
Skip to first unread message

wwaz wwaz

unread,
Dec 2, 2016, 3:02:32 AM12/2/16
to openresty
我是想做session_ticket_key来用的,类似于  openssl rand 48 > ticket.key 

有相应的库或者API么?

wwaz wwaz

unread,
Dec 2, 2016, 3:16:57 AM12/2/16
to openresty

额,找到一种方法了,目前用的春哥的resty.random库。
      local random_byte=require("resty.random").bytes
      local tickety_key=random_byte(48)

希望能够work

在 2016年12月2日星期五 UTC+8下午4:02:32,wwaz wwaz写道:

Ming

unread,
Dec 2, 2016, 3:36:24 AM12/2/16
to open...@googlegroups.com
自然是可以的,内部也是调用的 OpenSSL 的 API。

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html

Reply all
Reply to author
Forward
0 new messages