This repository has been archived on 2023-06-17. You can view files and clone it, but cannot push or open issues/pull-requests.
|
#!/usr/bin/env ruby
|
|
## Copyright © 2017 Graham Sanderson, all rights reserved.
|
|
## strh: Simple string hash utility.
|
|
|
|
res = 0
|
|
|
|
for ch in ARGV[0].each_codepoint
|
|
res = res * 101 + ch
|
|
res &= 0x7FFFFFFF
|
|
end
|
|
|
|
print res
|
|
|
|
## EOF
|