Class: InlineSvg::IdGenerator
- Inherits:
-
Object
- Object
- InlineSvg::IdGenerator
- Defined in:
- lib/inline_svg/id_generator.rb
Defined Under Namespace
Classes: Randomness
Class Method Summary collapse
Class Method Details
.generate(base, salt, randomness: Randomness) ⇒ Object
12 13 14 15 |
# File 'lib/inline_svg/id_generator.rb', line 12 def self.generate(base, salt, randomness: Randomness) bytes = Digest::SHA1.digest("#{base}-#{salt}-#{randomness.call}") 'a' + Digest.hexencode(bytes).to_i(16).to_s(36) end |