Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/my_string_extend_slw.rb
Overview
my_string_extend_slw.rb
Instance Method Summary collapse
Instance Method Details
#djb2Hash ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/my_string_extend_slw.rb', line 3 def djb2Hash self.split("").each do |c| hashConst = 5381 hashConst = ((hashConst << 5) + hashConst) + c.ord return hashConst end end |