Skip to content

A Clojure library designed to generate secure random float,int,bytes and strings based on java.security.SecureRandom

License

Notifications You must be signed in to change notification settings

killme2008/secure-rand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

secure-rand

A Clojure library designed to generate secure random float,int,bytes and strings based on java.security.SecureRandom.

Usage

[secure-rand "0.1"]

Secure version of rand, rand-int and rand-nth

(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

(secure-rand.core/bytes size)

Returns a secure random byte array of the specified size.

(secure-rand.core/base64 size)

Return a secure random base64 string of the specified size in bytes.

(secure-rand.core/base32 size)

Return a secure random base32 string of the specified size in bytes.

(secure-rand.core/hex size)

Return a secure random hex string of the specified size in bytes.

License

Copyright © 2014 Dennis Zhuang [killme2008@gmail.com]

Distributed under the Eclipse Public License 1.0

About

A Clojure library designed to generate secure random float,int,bytes and strings based on java.security.SecureRandom

Resources

License

Stars

Watchers

Forks

Packages