Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/killme2008/secure-rand
A Clojure library designed to generate secure random float,int,bytes and strings based on java.security.SecureRandom
https://github.com/killme2008/secure-rand
Last synced: about 1 month ago
JSON representation
A Clojure library designed to generate secure random float,int,bytes and strings based on java.security.SecureRandom
- Host: GitHub
- URL: https://github.com/killme2008/secure-rand
- Owner: killme2008
- License: epl-1.0
- Created: 2014-06-10T15:30:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-10T15:39:45.000Z (over 10 years ago)
- Last Synced: 2024-10-07T18:18:25.043Z (about 1 month ago)
- Language: Clojure
- Homepage:
- Size: 133 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# secure-rand
A Clojure library designed to generate secure random float,int,bytes and strings based on [java.security.SecureRandom](http://docs.oracle.com/javase/7/docs/api/java/security/SecureRandom.html).
## Usage
``` clojure
[secure-rand "0.1"]
```### Secure version of rand, rand-int and rand-nth
``` clojure
(ns test
(:refer-clojure :exclude [rand rand-int rand-nth])
(:use [secure-rand.core :only [rand rand-int rand-nth]]))(rand)
(rand 10)
(rand-int 100)
(rand-nth (range 10))
```### Other functions
``` clojure
(secure-rand.core/bytes size)
```Returns a secure random byte array of the specified size.
``` clojure
(secure-rand.core/base64 size)
```Return a secure random base64 string of the specified size in bytes.
``` clojure
(secure-rand.core/base32 size)
```
Return a secure random base32 string of the specified size in bytes.``` clojure
(secure-rand.core/hex size)
```
Return a secure random hex string of the specified size in bytes.## License
Copyright © 2014 Dennis Zhuang [[email protected]]
Distributed under the Eclipse Public License 1.0