codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
puts("Here is what the Sass unique-id() function should return") def unique_id require 'securerandom' String.new("u" + SecureRandom.hex(16)) rescue LoadError options = {} options[:last_unique_id] ||= begin min = 9500000000000000000 max = 10000000000000000000 range = max - min rand(range) + min end options[:last_unique_id] = options[:last_unique_id].succ String.new("u"+options[:last_unique_id].to_s(16)) end $i = 0 $num = 10 while $i < $num do puts unique_id() $i += 1 end
Private
[
?
]
Run code
Submit