module Twingly::URL::Hasher
Constants
- MD5_DIGEST
Instantiate digest classes in a thread-safe manner This is important since we don't know how people will use this gem (if they require it in a thread safe way)
- SHA256_DIGEST
Public Instance Methods
autopingdb_hash(url)
click to toggle source
# File lib/twingly/url/hasher.rb, line 30 def autopingdb_hash(url) SHA256_DIGEST.digest(url).unpack("q")[0] end
blogstream_hash(url)
click to toggle source
# File lib/twingly/url/hasher.rb, line 22 def blogstream_hash(url) MD5_DIGEST.hexdigest(url)[0..29].upcase end
documentdb_hash(url)
click to toggle source
# File lib/twingly/url/hasher.rb, line 26 def documentdb_hash(url) SHA256_DIGEST.digest(url).unpack("L!")[0] end
taskdb_hash(url)
click to toggle source
# File lib/twingly/url/hasher.rb, line 18 def taskdb_hash(url) MD5_DIGEST.hexdigest(url)[0..29].upcase end