Server IP : 111.118.215.189 / Your IP : 18.222.106.93 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/emacs/24.3/lisp/mail/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:11:42 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/mail/hashcash.el ;;; in Emacs version 24.3.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\204 \302\301\303\304B\"\210\305\306\307\310\311\312%\210\313\314\315\316\317\320\311\306&\210\313\321\322\323\317\324\311\306&\210\313\325\315\326\317\320\311\306&\210\313\327\330\331\311\306%\210\313\332\333\334\311\306%\210\313\335\307\336\317\337\311\306&\210\313\340\341\342\311\306%\210\313\343\307\344\317\345\311\306&\207" [fboundp declare-function defalias macro #[(&rest r) "\300\207" [nil] 1] custom-declare-group hashcash nil "Hashcash configuration." :group mail custom-declare-variable hashcash-default-payment 20 "The default number of bits to pay to unknown users.\nIf this is zero, no payment header will be generated.\nSee `hashcash-payment-alist'." :type integer hashcash-payment-alist 'nil "An association list mapping email addresses to payment amounts.\nElements may consist of (ADDR AMOUNT) or (ADDR STRING AMOUNT), where\nADDR is the email address of the intended recipient and AMOUNT is\nthe value of hashcash payment to be made to that user. STRING, if\npresent, is the string to be hashed; if not present ADDR will be used." (repeat (choice (list :tag "Normal" (string :name "Address") (integer :name "Amount")) (list :tag "Replace hash input" (string :name "Address") (string :name "Hash input") (integer :name "Amount")))) hashcash-default-accept-payment "The default minimum number of bits to accept on incoming payments." hashcash-accept-resources `((,user-mail-address nil)) "An association list mapping hashcash resources to payment amounts.\nResources named here are to be accepted in incoming payments. If the\ncorresponding AMOUNT is NIL, the value of `hashcash-default-accept-payment'\nis used instead." hashcash-path (executable-find "hashcash") "The path to the hashcash binary." hashcash-extra-generate-parameters "A list of parameter strings passed to `hashcash-path' when minting.\nFor example, you may want to set this to '(\"-Z2\") to reduce header length." (repeat string) hashcash-double-spend-database "hashcash.db" "The path to the double-spending database." hashcash-in-news "Specifies whether or not hashcash payments should be made to newsgroups." boolean] 8) #@55 Alist of asynchronous hashcash processes and buffers. (defvar hashcash-process-alist nil (#$ . 2696)) (byte-code "\300\301!\210\302\303!\203 \304\305\303\"\210\202 \304\305\306\"\210\302\307!\203% \304\310\307\"\210\202* \304\310\311\"\210\300\207" [require mail-utils fboundp point-at-bol defalias hashcash-point-at-bol line-beginning-position point-at-eol hashcash-point-at-eol line-end-position] 3) (defalias 'hashcash-strip-quoted-names #[(addr) "\301!\211\203 \302\303\"\203 \304\305\"\304\306\"P\207\207" [addr mail-strip-quoted-names string-match "\\`\\([^+@]+\\)\\+[^@]*\\(@.+\\)" match-string 1 2] 5]) (defalias 'hashcash-token-substring #[nil "\212\301\302\303\215*\207" [token "" --cl-block-nil-- (byte-code "`\301 {P\301 b\210\302u\210\303\304!\204 \305\306\"\210\303\304!\203 \302u\210\202 " [token hashcash-point-at-eol 1 looking-at "[ ]" throw --cl-block-nil--] 3)] 2]) #@67 Return the hashcash payment value required for the given address. (defalias 'hashcash-payment-required #[(addr) "\304 \"\305\n8\206 \nA@\206 )\207" [addr hashcash-payment-alist val hashcash-default-payment assoc 2] 3 (#$ . 3605)]) #@64 Return the string with which hashcash payments should collide. (defalias 'hashcash-payment-to #[(addr) "\303 \"\211A@\206 \n@\206 )\207" [addr hashcash-payment-alist val assoc] 4 (#$ . 3847)]) #@67 Generate a hashcash payment by finding a VAL-bit collison on STR. (defalias 'hashcash-generate-payment #[(str val) "\304V\203+ \203+ r\305\306!q\210\307 \210\310\311 \312\313\312\314\315\316\317!\n&\210eb\210\320 )\207\321\322!\207" [val hashcash-path str hashcash-extra-generate-parameters 0 get-buffer-create " *hashcash*" erase-buffer apply call-process nil t "-m" "-q" "-b" number-to-string hashcash-token-substring error "No `hashcash' binary found"] 12 (#$ . 4051)]) #@138 Generate a hashcash payment by finding a VAL-bit collison on STR. Return immediately. Call CALLBACK with process and result when ready. (defalias 'hashcash-generate-payment-async #[(str val callback) "\306V\203. \203. \307\310\311\312 \313\314\315\316!\n&\n\211pB B\317\f\320\321\322\323BBE\")\207\312\211\"\207" [val hashcash-path str hashcash-extra-generate-parameters process hashcash-process-alist 0 apply start-process "hashcash" nil "-m" "-q" "-b" number-to-string set-process-filter lambda (process output) funcall (process output) callback] 12 (#$ . 4536)]) #@43 Check the validity of a hashcash payment. (defalias 'hashcash-check-payment #[(token str val) "\203 \305\306\307\211\211\310\311\312 \313\314\n!\315\f& !\207\316\317!\210\320\321!\210\307\207" [hashcash-path hashcash-double-spend-database val str token zerop call-process nil "-c" "-d" "-f" "-b" number-to-string "-r" message "No hashcash binary found" sleep-for 1] 15 (#$ . 5119)]) #@46 Find the format version of a hashcash token. (defalias 'hashcash-version #[(token) "\301H\302\232\203\n \303\207\304H\302\232\203 \305\207\306\307!\207" [token 1 58 1.2 6 1.1 error "Unknown hashcash format version"] 2 (#$ . 5512)]) #@58 Check for hashcash token to RECIPIENT in current buffer. (defalias 'hashcash-already-paid-p #[(recipient) "\212\214\303 \210\304\305!\306\211;\205 \307\310\n! \",\207" [case-fold-search token recipient message-narrow-to-headers-or-head message-fetch-field "x-hashcash" t string-match regexp-quote] 4 (#$ . 5753)]) #@64 Insert X-Payment and X-Hashcash headers with a payment for ARG (defalias 'hashcash-insert-payment #[(arg) "\302!?\205 \303\304!\305!\"\211\205 \306\307 \310#)\207" [arg pay hashcash-already-paid-p hashcash-generate-payment hashcash-payment-to hashcash-payment-required insert-before-markers "X-Hashcash: " "\n"] 5 (#$ . 6076) "sPay to: "]) #@122 Insert X-Payment and X-Hashcash headers with a payment for ARG Only start calculation. Results are inserted when ready. (defalias 'hashcash-insert-payment-async #[(arg) "\301!?\205 \302\303!\304!\305\306\307p\310BBE#\207" [arg hashcash-already-paid-p hashcash-generate-payment-async hashcash-payment-to hashcash-payment-required lambda (process payment) hashcash-insert-payment-async-2 (process payment)] 8 (#$ . 6429) "sPay to: "]) (defalias 'hashcash-insert-payment-async-2 #[(buffer process pay) "\304!\205 rq\210\212\214\305 \n\236\n\"\306 \210\205 \307\310\"+\207" [buffer process hashcash-process-alist pay buffer-live-p delq message-goto-eoh insert-before-markers "X-Hashcash: "] 3]) #@94 Delete any hashcash processes associated with BUFFER. BUFFER defaults to the current buffer. (defalias 'hashcash-cancel-async #[(&optional buffer) "\204 p\303\304\n\"\211\205 \305 @!\210\306 \n\"\202 )\207" [buffer entry hashcash-process-alist nil rassq delete-process delq] 3 (#$ . 7138) nil]) #@102 Wait for asynchronous hashcash processes in BUFFER to finish. BUFFER defaults to the current buffer. (defalias 'hashcash-wait-async #[(&optional buffer) "\204 p\303\304\n\"\211\205 \305 @\306\"\210\202 )\207" [buffer entry hashcash-process-alist nil rassq accept-process-output 1] 3 (#$ . 7449) nil]) #@67 Return non-nil if hashcash processes in BUFFER are still running. (defalias 'hashcash-processes-running-p #[(buffer) "\302 \"\207" [buffer hashcash-process-alist rassq] 3 (#$ . 7764)]) #@60 Ask user whether to wait for hashcash processes to finish. (defalias 'hashcash-wait-or-cancel #[nil "\300p!\205 \301\302!\203 \303 \207\304 \207" [hashcash-processes-running-p y-or-n-p "Hashcash process(es) still running; wait for them to finish? " hashcash-wait-async hashcash-cancel-async] 2 (#$ . 7956) nil]) #@27 Verify a hashcash payment (defalias 'hashcash-verify-payment #[(token &optional resource amount) "\306\307\"\310!\311W\203 A@\2020 \312 @!\313\n\314\"\203% \315 8\202/ \313\n\316\"\205/ \317 8)\f\204V \320 \"\211\205R \321@\211A@)\206Q #)\202k \232\203j \321\f\206f #\202k \322*\207" [token split #1=#:--cl-var-- key resource hashcash-accept-resources split-string ":" hashcash-version 1.2 string-to-number eql 0 2 1 3 assoc hashcash-check-payment nil elt x hashcash-default-accept-payment amount] 5 (#$ . 8276)]) #@221 Add X-Payment: and X-Hashcash: headers with a hashcash payment for each recipient address. Prefix arg sets default payment temporarily. Set ASYNC to t to start asynchronous calculation. (See `mail-add-payment-async'). (defalias 'mail-add-payment #[(&optional arg async) "\203\n \306!\202 \307\212\214\310 \210\311\312\313\307\314#!\311\312\315\307\314#!\311\312\316\307\314#!\211\2034 \317 \320\"\f\203? \n\317\f\320\"\244\203O \203O \n\317\320\"\244+\n\203b \321\203^ \322\202_ \323\n\"\210,\314\207" [arg hashcash-default-payment addrlist ng cc to prefix-numeric-value nil message-narrow-to-headers hashcash-strip-quoted-names mail-fetch-field "To" t "Cc" "Newsgroups" split-string ",[ \n]*" mapc hashcash-insert-payment-async hashcash-insert-payment hashcash-in-news async] 8 (#$ . 8823) "P"]) #@167 Add X-Payment: and X-Hashcash: headers with a hashcash payment for each recipient address. Prefix arg sets default payment temporarily. Calculation is asynchronous. (defalias 'mail-add-payment-async #[(&optional arg) "\301\302\"\207" [arg mail-add-payment t] 3 (#$ . 9648) "P"]) #@103 Look for a valid X-Payment: or X-Hashcash: header. Prefix arg sets default accept amount temporarily. (defalias 'mail-check-payment #[(&optional arg) "\203\n \306!\202 \307\310\311\312\"!\212eb\210\313\314!\210\315 \210`\316eb\210\204N \313\317\f\320#\203N \321\322 \323\"\211@\324\n!\232\203J \325 \211A@)!)\202% eb\210\204f \313\326\f\320#\203f \325\322 !\211\203U \203n \327\330!\210-\207" [arg hashcash-default-accept-payment version ok end value prefix-numeric-value hashcash-version hashcash-generate-payment "x" 1 search-forward "\n\n" beginning-of-line nil "X-Payment: hashcash " t split-string hashcash-token-substring " " number-to-string hashcash-verify-payment "X-Hashcash: " message "Payment valid" x] 6 (#$ . 9936) "P"]) (provide 'hashcash)