Skip to content

Instantly share code, notes, and snippets.

@g000001
Created November 7, 2008 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g000001/22849 to your computer and use it in GitHub Desktop.
Save g000001/22849 to your computer and use it in GitHub Desktop.
(defun urand-list (n &optional (byte 8))
(with-open-file (in "/dev/urandom" :element-type `(unsigned-byte ,byte))
(loop :repeat n :collect (read-byte in nil nil))))
(urand-list 3 256)
;=> (60911427192963316011544747287595784556349539712748006065011672149122741877820
; 75457469479310454168834878462254762462403698881818960517980139665538208344748
; 108658200307104181631682704758907704792362235556132495755053705541055592739152)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment