Function: org-knuth-hash

org-knuth-hash is a byte-compiled function defined in org-macs.el.gz.

Signature

(org-knuth-hash NUMBER &optional (BASE 32))

Documentation

Calculate Knuth's multiplicative hash for NUMBER.

BASE is the maximum bitcount. Credit: https://stackoverflow.com/questions/11871245/knuth-multiplicative-hash#41537995

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-macs.el.gz
(cl-defun org-knuth-hash (number &optional (base 32))
  "Calculate Knuth's multiplicative hash for NUMBER.
BASE is the maximum bitcount.
Credit: https://stackoverflow.com/questions/11871245/knuth-multiplicative-hash#41537995"
  (cl-assert (and (<= 0 base 32)))
  (ash (* number 2654435769) (- base 32)))