SecureRandom加密的强随机数生成器
来源:互联网 发布:vb for mac下载 编辑:程序博客网 时间:2024/04/27 16:01
(1)base64(n=nil)
::base64 generates a random base64 string.
The argument n specifies the length of the random length. The length of the result string is about 4/3 of n.
If n is not specified, 16 is assumed. It may be larger in future.
The result may contain A-Z, a-z, 0-9, “+”, “/” and “=”.
p SecureRandom.base64 #=> "/2BuBuLf3+WfSKyQbRcc/A=="p SecureRandom.base64 #=> "6BbW0pxO0YENxn38HMUbcQ=="
(2)hex(n=nil)
::hex generates a random hex string.
The argument n specifies the length of the random length. The length of the result string is twice of n.
If n is not specified, 16 is assumed. It may be larger in future.
The result may contain 0-9 an
<span style="font-size:14px;">p SecureRandom.hex #=> "eb693ec8252cd630102fd0d0fb7c3485"p SecureRandom.hex #=> "91dc3bfb4de5b11d029d376634589b61"</span>
(3)uuid()
::uuid generates a v4 random UUID (Universally Unique IDentifier).
p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"p SecureRandom.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"p SecureRandom.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
0 0
- SecureRandom加密的强随机数生成器
- java加密的强随机数生成器
- Java中的随机数生成器:Random,ThreadLocalRandom,SecureRandom
- Java中的随机数生成器:Random,ThreadLocalRandom,SecureRandom
- Java中的随机数生成器:Random,ThreadLocalRandom,SecureRandom .
- Java中的随机数生成器:Random,ThreadLocalRandom,SecureRandom
- SecureRandom生成“强随机数”用于生成RSA*公钥/私钥*window和linux下不一致的问题
- [转]Java中的随机数生成器:Random,ThreadLocalRandom,SecureRandom
- 加密法随机数生成器
- 严格的随机数生成器
- 使用加密服务提供程序 (CSP) 提供的实现来实现加密随机数生成器 (RNG)
- Java 8 SecureRandom 生成随机数
- Silverlight信息加密 - 通过Rfc2898DeriveBytes类使用基于HMACSHA1的伪随机数生成器实现PBKDF2
- Insecure Randomness引发对随机数生成器抵挡加密攻击的方法
- SecureRandom生成随机数超慢 导致tomcat启动时间过长的解决办法
- SecureRandom生成随机数超慢 导致tomcat启动时间过长的解决办法
- 随机数生成器
- 随机数生成器
- AMFPHP1.4与PHP5.3及以上版本不兼容问题的解决
- leetcode_186_Reverse Words in a String
- 关于ZBar与支付宝 symbol _base64_encode 的解决方案
- springMVC学习(一)
- java常用集合总结
- SecureRandom加密的强随机数生成器
- 照片无缝滚动的实现
- c++基础学习6-c++面向对象基本概念
- Android 4.0及以上版本接收开机广播BOOT_COMPLETED、开机自启动服务
- 妄念少 吃得少
- Linux编程基础——后台进程 守护进程
- JavaScript能获取的所有浏览器信息
- JAVA 图片格式检查方法
- android 自动完成文本框AutoCompleteTextView 完整版