Function: ntlm--time-to-timestamp
ntlm--time-to-timestamp is a byte-compiled function defined in
ntlm.el.gz.
Signature
(ntlm--time-to-timestamp TIME)
Documentation
Convert TIME to an NTLMv2 timestamp.
Return a unibyte string representing the number of tenths of a microsecond since January 1, 1601 as a 64-bit little-endian signed integer. TIME must be on the form (HIGH LOW USEC PSEC).
Source Code
;; Defined in /usr/src/emacs/lisp/net/ntlm.el.gz
(defun ntlm--time-to-timestamp (time)
"Convert TIME to an NTLMv2 timestamp.
Return a unibyte string representing the number of tenths of a
microsecond since January 1, 1601 as a 64-bit little-endian
signed integer. TIME must be on the form (HIGH LOW USEC PSEC)."
(let* ((s-hi (ntlm--bignat-of-int (nth 0 time)))
(s-lo (ntlm--bignat-of-int (nth 1 time)))
(s (ntlm--bignat-add (ntlm--bignat-shift-left s-hi 2) s-lo))
(us*10 (ntlm--bignat-of-int (* (nth 2 time) 10)))
(ps/1e5 (ntlm--bignat-of-int (/ (nth 3 time) 100000)))
;; tenths of microseconds between 1601-01-01 and 1970-01-01
(to-unix-epoch (ntlm--bignat-of-string "116444736000000000"))
(tenths-of-us-since-jan-1-1601
(ntlm--bignat-add
(ntlm--bignat-add
(ntlm--bignat-add
(ntlm--bignat-mul s (ntlm--bignat-of-int 10000000))
us*10)
ps/1e5)
to-unix-epoch)))
(ntlm--bignat-to-int64 tenths-of-us-since-jan-1-1601)))